/* ENVIEX · portal de clientes. Misma paleta y tipografía que el sitio: navy, naranja, Montserrat e Inter. */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Montserrat; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Montserrat; font-weight: 800; font-display: swap; src: url(fonts/montserrat-latin-800-normal.woff2) format("woff2"); }

:root {
  --navy: #05163d; --navy-2: #1D2B53; --naranja: #FF9F00; --naranja-osc: #db8700; --naranja-f: #fff6e6;
  --fondo: #f5f6f8; --sup: #fff; --borde: #e1e4ea; --texto: #191c1d; --tenue: #5b6275;
  --ok: #15803d; --ok-f: #e8f6ed; --mal: #c62828; --mal-f: #fdecec; --info: #1d4ed8; --info-f: #eaf0ff; --gris-f: #eef0f3;
  --radio: 14px; --sombra: 0 1px 2px rgba(5,22,61,.05), 0 4px 16px rgba(5,22,61,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .cifra, .marca { font-family: Montserrat, Inter, sans-serif; }
h1 { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin: 0 0 .75rem; }
h3 { font-size: .95rem; font-weight: 700; color: var(--navy); margin: 0 0 .5rem; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sub { color: var(--tenue); font-size: .86rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.derecha { text-align: right; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- acceso ---------- */
.acceso { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.acceso-lado { background: var(--navy); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.acceso-lado::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 380px; height: 380px; border-radius: 50%; border: 2px solid rgba(255,159,0,.55); box-shadow: 0 0 0 46px rgba(255,255,255,.035), 0 0 0 92px rgba(255,255,255,.02); }
.acceso-lado img { height: 34px; align-self: flex-start; }
.acceso-lado h1 { color: #fff; font-size: 2.2rem; max-width: 420px; line-height: 1.15; }
.acceso-lado p { color: #c9d1e6; max-width: 420px; }
.acceso-lado ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; color: #e3e8f4; }
.acceso-lado li { display: flex; gap: .6rem; align-items: center; }
.acceso-lado li svg { color: var(--naranja); }
.acceso-form { display: grid; place-items: center; padding: 2rem 1.25rem; }
.acceso-form form { width: 100%; max-width: 380px; }
.acceso-form .logo-movil { display: none; height: 30px; margin-bottom: 1.5rem; }

/* ---------- formularios ---------- */
.campo { margin-bottom: 1rem; }
.campo label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .3rem; color: var(--navy); }
.campo .opc { font-weight: 400; color: var(--tenue); }
.control { width: 100%; border: 1.5px solid var(--borde); background: #fff; border-radius: 10px; padding: .62rem .8rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.control:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29,43,83,.12); }
.campo.error .control { border-color: var(--mal); }
.campo .msg { color: var(--mal); font-size: .8rem; margin-top: .25rem; }
textarea.control { resize: vertical; min-height: 80px; }
.fila-campos { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; border-radius: 10px; padding: .65rem 1.1rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-principal { background: var(--naranja); color: var(--navy); }
.btn-principal:hover { background: var(--naranja-osc); }
.btn-borde { background: #fff; border: 1.5px solid var(--borde); color: var(--navy); }
.btn-borde:hover { border-color: var(--navy-2); }
.btn-peligro { background: #fff; border: 1.5px solid #f2c4c4; color: var(--mal); }
.btn-ancho { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn:focus-visible, .control:focus-visible, .nav a:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* ---------- estructura ---------- */
.barra { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.barra-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.25rem; }
.barra img { height: 26px; }
.barra .cliente { margin-left: auto; text-align: right; font-size: .85rem; line-height: 1.2; }
.barra .cliente small { display: block; color: #aab4cf; }
.barra .salir { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: .35rem .7rem; cursor: pointer; }
.nav { background: var(--navy-2); }
.nav-in { max-width: 1180px; margin: 0 auto; display: flex; gap: .25rem; padding: 0 1rem; overflow-x: auto; scrollbar-width: none; }
.nav-in::-webkit-scrollbar { display: none; }
.nav a { color: #cfd6e8; text-decoration: none; padding: .75rem .9rem; display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: #fff; }
.nav a.activo { color: #fff; border-bottom-color: var(--naranja); }
main { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.cab p { margin: 0; color: var(--tenue); }
.volver { display: inline-flex; align-items: center; gap: .3rem; color: var(--tenue); text-decoration: none; font-size: .88rem; margin-bottom: .75rem; }

.tarjeta { background: var(--sup); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.25rem; }
.rejilla { display: grid; gap: 1rem; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 1.25rem; }
.kpi { display: flex; gap: .9rem; align-items: center; text-decoration: none; color: inherit; }
.kpi .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--gris-f); color: var(--navy); display: grid; place-items: center; }
.kpi.acento .ico { background: var(--naranja); }
.cifra { font-size: 1.45rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.dos { grid-template-columns: 2fr 1fr; align-items: start; }

/* tablas que se vuelven tarjetas en el teléfono */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tenue); font-weight: 600; padding: .6rem .75rem; border-bottom: 1px solid var(--borde); }
.tabla td { padding: .75rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr.clic { cursor: pointer; }
.tabla tbody tr.clic:hover { background: #fafbfc; }
.tabla .sub { display: block; }
.folio { font-family: Montserrat, Inter, sans-serif; font-weight: 700; color: var(--navy); text-decoration: none; }
.chip { display: inline-block; font-size: .74rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: var(--gris-f); color: #475066; white-space: nowrap; }
.chip.ok { background: var(--ok-f); color: var(--ok); } .chip.mal { background: var(--mal-f); color: var(--mal); }
.chip.info { background: var(--info-f); color: var(--info); } .chip.alerta { background: var(--naranja-f); color: #9a5b00; }
.vacio { text-align: center; color: var(--tenue); padding: 2.5rem 1rem; }
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtros .control { width: auto; min-width: 160px; }
.filtros input.control { flex: 1; min-width: 200px; }
.paginacion { display: flex; justify-content: space-between; align-items: center; padding-top: .9rem; color: var(--tenue); font-size: .86rem; }

/* línea de tiempo del rastreo */
.linea { list-style: none; margin: 0; padding: 0; }
.linea li { position: relative; padding: 0 0 1.1rem 1.6rem; }
.linea li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--borde); }
.linea li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--borde); }
.linea li:last-child::after { display: none; }
.linea li:first-child::before { background: var(--naranja); box-shadow: 0 0 0 4px var(--naranja-f); }
.linea strong { display: block; color: var(--navy); }
.datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem 1.5rem; margin: 0; }
.datos dt { font-size: .75rem; color: var(--tenue); text-transform: uppercase; letter-spacing: .04em; }
.datos dd { margin: .1rem 0 0; font-weight: 600; }
.evidencias { display: flex; gap: .75rem; flex-wrap: wrap; }
.evidencias img { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--borde); background: #fff; }
.evidencias img.firma { object-fit: contain; }
.desglose { width: 100%; border-collapse: collapse; }
.desglose td { padding: .3rem 0; }
.desglose td:last-child { text-align: right; }
.desglose tr.total td { border-top: 1.5px solid var(--borde); padding-top: .55rem; font-weight: 800; font-family: Montserrat, Inter, sans-serif; color: var(--navy); font-size: 1.1rem; }
.caja { background: var(--naranja-f); border: 1px solid #f6d79f; border-radius: 10px; padding: .8rem 1rem; color: #6d4200; font-size: .9rem; }
.lista-check { display: grid; gap: .35rem; max-height: 340px; overflow: auto; border: 1px solid var(--borde); border-radius: 10px; padding: .5rem; }
.lista-check label { display: flex; gap: .6rem; align-items: center; padding: .35rem .4rem; border-radius: 8px; cursor: pointer; }
.lista-check label:hover { background: #fafbfc; }
.lista-check input { width: 18px; height: 18px; accent-color: var(--navy); }
.paquete { display: grid; grid-template-columns: 70px 80px repeat(3, 70px) 1fr 36px; gap: .5rem; align-items: end; margin-bottom: .5rem; }
.quitar { border: 0; background: transparent; color: var(--mal); cursor: pointer; padding: .55rem; border-radius: 8px; }

.aviso { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .75rem 1.1rem; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.2); z-index: 50; max-width: calc(100% - 2rem); }
.aviso.mal { background: var(--mal); }
.cargando { color: var(--tenue); padding: 2rem 0; }

@media (max-width: 900px) {
  .acceso { grid-template-columns: 1fr; }
  .acceso-lado { display: none; }
  .acceso-form .logo-movil { display: block; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dos { grid-template-columns: 1fr; }
  .barra .cliente small { display: none; }
}
@media (max-width: 640px) {
  main { padding: 1.25rem 1rem 3rem; }
  h1 { font-size: 1.35rem; }
  .barra-in { gap: .75rem; padding: .6rem 1rem; }
  .barra .cliente { font-size: .78rem; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { border-bottom: 1px solid var(--borde); padding: .6rem 0; }
  .tabla td { border: 0; padding: .15rem 0; }
  .tabla td.derecha { text-align: left; }
  .kpi .cifra { font-size: 1.2rem; }
  .paquete { grid-template-columns: repeat(3, 1fr); }
  .paquete .desc { grid-column: 1 / -1; }
  .filtros .control { flex: 1 1 100%; }
}
