/* ===== Control de entrega ===== */
.chip.azul { background: #e3eef7; color: #0b5a8a; }

/* Contadores = filtros */
.ent-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.ent-k { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--sh); cursor: pointer; text-align: left; color: var(--ink); min-width: 0; transition: border-color .15s, box-shadow .15s; }
.ent-k span { font-size: 12.5px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.ent-k b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ent-k small { font-size: 11.5px; color: var(--muted); }
.ent-k:hover { border-color: var(--line2); }
.ent-k[aria-pressed="true"] { border-color: var(--dark); box-shadow: 0 0 0 1px var(--dark), var(--sh); }
.ent-k.alerta { background: var(--danger-soft); border-color: #f0c4be; }
.ent-k.alerta span, .ent-k.alerta b { color: var(--danger); }
.ent-k.alerta[aria-pressed="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* Tarjeta de pedido */
.ent-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); align-items: start; }
.ent { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; display: grid; gap: 12px; border: 1px solid transparent; cursor: pointer; min-width: 0;
  border-left: 4px solid var(--line2); transition: box-shadow .15s; }
.ent:hover { box-shadow: 0 2px 4px rgba(35,31,32,.06), 0 10px 28px rgba(35,31,32,.09); }
.ent.ent-listo { border-left-color: var(--lis); }
.ent.ent-camino { border-left-color: #2b7bb9; }
.ent.ent-entregado { border-left-color: var(--lis); opacity: .92; }
.ent.atrasado { border-left-color: var(--danger); }
.ent-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ent-quien { display: flex; flex-direction: column; min-width: 0; }
.ent-n { font-size: 12px; font-weight: 700; color: var(--brand-ink); }
.ent-quien b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-quien small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-prod { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ent-fotos { display: flex; flex: none; }
.ent-fotos .op-mini { width: 44px; height: 44px; border: 2px solid #fff; border-radius: 10px; }
.ent-fotos .op-mini + .op-mini { margin-left: -10px; }
.ent-fotos .op-mini svg { width: 20px; height: 20px; }
.ent-fotos .mas { font-size: 12px; font-weight: 700; color: var(--muted); }
.ent-nom { font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Pasos */
.ent-pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ent-paso { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; position: relative; min-width: 0; }
.ent-paso::before { content: ''; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.ent-paso:first-child::before { display: none; }
.ent-paso.hecho::before { background: var(--lis); }
.ent-pt { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #f1ede8; color: #a79e94; position: relative; z-index: 1; border: 2px solid #fff; }
.ent-pt svg { width: 16px; height: 16px; }
.ent-paso.hecho .ent-pt { background: var(--lis); color: #fff; }
.ent-paso.actual .ent-pt { background: var(--accent-soft); color: #8a5a00; box-shadow: 0 0 0 2px var(--accent); }
.ent-paso.actual.tarde .ent-pt { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.ent-paso b { font-size: 12px; line-height: 1.2; }
.ent-paso b .ct { display: none; }
.ent-paso small { font-size: 11.5px; color: var(--muted); line-height: 1.2; overflow-wrap: anywhere; }
.ent-paso:not(.hecho):not(.actual) b { color: var(--muted); }

/* Fechas, tiempo y saldo */
.ent-pie { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.ent-fechas { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.ent-fechas b { color: var(--ink); }
.ent-saldo { font-size: 13.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.ent-saldo b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.ent-tiempo { grid-column: 1 / -1; display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.ent-tiempo b { color: var(--ink); }
.ent-tiempo i { display: block; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--brand) var(--k), #ece7e0 var(--k)); }
.ent-tiempo.cerca i { background: linear-gradient(90deg, var(--accent) var(--k), #ece7e0 var(--k)); }
.ent-tiempo.pasado i { background: var(--danger); }
.ent-tiempo.pasado b { color: var(--danger); }
.ent-entregado .ent-tiempo i { background: linear-gradient(90deg, var(--lis) var(--k), #ece7e0 var(--k)); }
.ent-entregado .ent-tiempo.pasado i { background: var(--danger); }
.ent-nota { margin: 0; font-size: 13.5px; background: #f8f6f2; border-radius: 10px; padding: 8px 12px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ent-acc { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ent-acc [data-ver] { margin-left: auto; }

/* Detalle */
.modal-card.ent-modal { max-width: 640px; padding: 22px; }
.ent-det { display: grid; gap: 12px; }
.ent-det > h2 { margin: 0; }
.ent-det > p { margin: 0 !important; }
.ent-det h3 { font-size: 14px; margin: 6px 0 -4px; }
.ent-det-f { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ent-det-f div { background: #f8f6f2; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.ent-det-f small { font-size: 12px; color: var(--muted); }
.ent-det-f b { font-size: 14px; }
.ent-det-p { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.ent-det-pc { display: flex; align-items: center; gap: 10px; }
.ent-det-pc .op-mini { width: 40px; height: 40px; }
.ent-det-p ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ent-det-p li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.ent-det-p li span { color: var(--muted); }
.ent-det-p li b { text-align: right; color: var(--muted); font-weight: 400; }
.ent-det-p li.si b { color: var(--lis-ink); font-weight: 700; }
.ent-det-acc { display: flex !important; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1240px) { .ent-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .ent-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ent-k { padding: 10px 12px; }
  .ent-k b { font-size: 20px; }
  .ent { padding: 14px 12px; }
  .ent-pt { width: 28px; height: 28px; }
  .ent-paso::before { top: 13px; }
  .ent-paso b { font-size: 11px; }
  .ent-paso small { font-size: 10.5px; }
  .ent-pie { grid-template-columns: minmax(0, 1fr); }
  .ent-saldo { text-align: left; }
  .ent-acc .btn:not(.btn-sm) { flex: 1; }
  .ent-det-f { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-card.ent-modal { padding: 18px 14px; }
}
@media (max-width: 420px) {
  .ent-paso b .lg { display: none; }
  .ent-paso b .ct { display: inline; }
  .ent-paso b, .ent-paso small { font-size: 10.5px; }
}

/* ===== Rastreo del cliente (detalle de factura, admin y jefes) ===== */
.rs-intro { margin: -6px 0 10px; font-size: 13.5px; overflow-wrap: anywhere; }
.rs-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rs-acc .btn svg { width: 17px; height: 17px; }
.rs-prod { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 12px; }
.rs-prod + .rs-prod { margin-top: 12px; }
.rs-cab { display: flex; align-items: center; gap: 10px; }
.rs-cab .op-mini { width: 44px; height: 44px; }
.rs-cab b { flex: 1; min-width: 0; font-size: 14.5px; }
.rs-pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rs-pasos li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.rs-pasos li::before { content: ''; position: absolute; top: 14px; right: 50%; width: 100%; height: 3px; background: var(--line); }
.rs-pasos li:first-child::before { display: none; }
.rs-pasos li.hecho::before { background: var(--lis); }
.rs-pt { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f1ede8; color: #a79e94; font-size: 13px; font-weight: 700; position: relative; z-index: 1; border: 2px solid #fff; }
.rs-pt svg { width: 15px; height: 15px; }
.rs-pasos li.hecho .rs-pt { background: var(--lis); color: #fff; }
.rs-pasos li.actual .rs-pt { background: var(--accent-soft); color: #8a5a00; box-shadow: 0 0 0 2px var(--accent); }
.rs-pasos b { font-size: 11.5px; line-height: 1.2; }
.rs-pasos li:not(.hecho):not(.actual) b { color: var(--muted); font-weight: 400; }
.rs-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rs-hist li { background: #f8f6f2; border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.rs-h1 { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.rs-h1 b { font-size: 14px; } .rs-h1 time { font-size: 12.5px; color: var(--brand-ink); font-weight: 700; }
.rs-hist dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 1px 12px; font-size: 13px; }
.rs-hist dt { color: var(--muted); } .rs-hist dd { margin: 0; overflow-wrap: anywhere; }
.rs-hist dd small { color: var(--muted); }
.rs-hist .btn-danger { justify-self: start; }
.rs-fotos { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-fotos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.rs-form { display: grid; gap: 12px; }
.rs-form .dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rs-nota { font-size: 12.5px; margin: 0 !important; }
.rs-fsel { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-fsel span { position: relative; }
.rs-fsel img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.rs-fsel button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--dark); color: #fff; cursor: pointer; line-height: 1; }
.rs-form .campo > .btn { justify-self: start; }
@media (max-width: 560px) { .rs-form .dos { grid-template-columns: minmax(0, 1fr); } .rs-pasos b { font-size: 10.5px; } }
/* 16 nov: tarjetas parejas; textos largos (direcciones) no estiran la tarjeta */
.ent-grid { align-items: stretch; }
.ent { grid-template-columns: minmax(0, 1fr); align-content: start; }
.ent > * { min-width: 0; }
.ent-cab .chip { flex: none; white-space: nowrap; }
.ent-quien { flex: 1 1 auto; }
.rs-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-btns .btn { flex: 1 1 calc(50% - 4px); min-height: 44px; justify-content: center; }

.rs-pedido { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #f6f2ec; font-size: 13.5px; margin-bottom: 12px; }
.rs-pedido b { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.rs-pedido .btn { justify-self: start; margin-top: 6px; }
