/* ENVIEX Operador · estilos (móvil primero, alto contraste para usar en la calle) */
:root {
  --navy: #05163d; --navy-2: #0c2459; --naranja: #FF9F00; --naranja-osc: #e08a00;
  --fondo: #f2f4f8; --borde: #dde2ea; --texto: #0f1a33; --tenue: #5d6880;
  --ok: #16a34a; --ok-f: #e7f6ec; --mal: #dc2626; --mal-f: #fdeaea; --info: #2563eb; --info-f: #e8efff; --alerta-f: #fff4e0;
  --radio: 14px; --seguro-arriba: env(safe-area-inset-top, 0px); --seguro-abajo: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
.oculto, [hidden] { display: none !important; }

/* barra superior */
.barra { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .5rem; background: var(--navy); color: #fff;
  padding: calc(.55rem + var(--seguro-arriba)) .75rem .55rem; min-height: 56px; }
.barra .logo { height: 22px; }
.barra .titulo { flex: 1; font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra .icono { width: 40px; height: 40px; border: 0; background: transparent; color: #fff; border-radius: 10px; display: grid; place-items: center; padding: 0; }
.barra .icono:active { background: rgba(255,255,255,.12); }
.barra svg { width: 24px; height: 24px; }
.estado-red { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.25); }
.estado-red.sin { background: var(--naranja); box-shadow: 0 0 0 3px rgba(255,159,0,.3); }
.aviso-sync { background: var(--alerta-f); color: #7a4b00; font-size: .85rem; padding: .5rem .9rem; border-bottom: 1px solid #f3dcb0; display: flex; gap: .5rem; align-items: center; }
.aviso-sync button { margin-left: auto; border: 0; background: transparent; color: #7a4b00; font-weight: 700; text-decoration: underline; }

main { padding: .9rem .9rem calc(6rem + var(--seguro-abajo)); max-width: 640px; margin: 0 auto; }
h1 { font-size: 1.35rem; margin: .25rem 0 .2rem; color: var(--navy); }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; color: var(--navy); }
.sub { color: var(--tenue); font-size: .88rem; }

/* tarjetas */
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem; margin-bottom: .75rem; box-shadow: 0 1px 2px rgba(5,22,61,.04); }
a.tarjeta, button.tarjeta { display: block; width: 100%; text-align: left; color: inherit; text-decoration: none; }
a.tarjeta:active, button.tarjeta:active { background: #f7f9fc; }
.fila { display: flex; align-items: center; gap: .6rem; }
.fila .crece { flex: 1; min-width: 0; }
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: #eef0f3; color: #4b5568; 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(--alerta-f); color: #a35f00; }
.folio { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .02em; }
.progreso { height: 8px; background: #e6e9ef; border-radius: 99px; overflow: hidden; margin: .6rem 0 .2rem; }
.progreso i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.datos { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; margin: .5rem 0 0; }
.datos dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tenue); font-weight: 700; }
.datos dd { margin: 0; font-weight: 600; }

/* paradas */
.parada { display: flex; gap: .75rem; align-items: flex-start; }
.parada .num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; }
.parada.entregada .num { background: var(--ok); } .parada.fallida .num { background: var(--mal); }
.parada.entregada, .parada.fallida { opacity: .72; }
.parada .nombre { font-weight: 700; }
.parada .dir { font-size: .9rem; color: var(--tenue); }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 52px; padding: .7rem 1.1rem; border-radius: 12px;
  border: 1px solid var(--borde); background: #fff; color: var(--navy); font-weight: 700; font-size: 1rem; text-decoration: none; width: 100%; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.primario { background: var(--naranja); border-color: var(--naranja); color: var(--navy); }
.btn.exito { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.peligro { background: #fff; border-color: #f1c4c4; color: var(--mal); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn[disabled] { opacity: .55; }
.botones { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .75rem 0; }
.botones .ancho { grid-column: 1 / -1; }
.pie-fijo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: linear-gradient(transparent, var(--fondo) 30%); padding: 1.2rem .9rem calc(.9rem + var(--seguro-abajo)); }
.pie-fijo > div { max-width: 640px; margin: 0 auto; display: grid; gap: .6rem; }

/* formularios */
.campo { margin-bottom: .9rem; }
.campo label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .3rem; color: var(--navy); }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 52px; border: 1px solid #c9d0dc; border-radius: 12px; padding: .7rem .85rem; background: #fff; font-size: 1.05rem; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 3px solid rgba(255,159,0,.35); border-color: var(--naranja); }
.campo .error { color: var(--mal); font-size: .85rem; margin-top: .3rem; }
.campo.invalido input, .campo.invalido .foto, .campo.invalido .firma { border-color: var(--mal); }
.opciones { display: grid; gap: .5rem; }
.opciones label { display: flex; gap: .7rem; align-items: center; min-height: 52px; padding: .6rem .85rem; border: 1px solid #c9d0dc; border-radius: 12px; background: #fff; font-weight: 600; color: var(--texto); margin: 0; }
.opciones input { width: 22px; height: 22px; min-height: 0; accent-color: var(--naranja); }
.foto { position: relative; border: 2px dashed #c9d0dc; border-radius: 12px; background: #fff; min-height: 150px; display: grid; place-items: center; overflow: hidden; color: var(--tenue); text-align: center; }
.foto img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.foto input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.foto svg { width: 40px; height: 40px; display: block; margin: 0 auto .3rem; color: var(--naranja-osc); }
.firma { border: 1px solid #c9d0dc; border-radius: 12px; background: #fff; position: relative; touch-action: none; }
.firma canvas { width: 100%; height: 190px; display: block; }
.firma .linea { position: absolute; left: 1rem; right: 1rem; bottom: 42px; border-bottom: 1px dashed #b7bfcc; pointer-events: none; }
.firma button { position: absolute; top: .4rem; right: .4rem; border: 0; background: #eef0f3; border-radius: 8px; padding: .3rem .6rem; font-size: .8rem; font-weight: 700; color: var(--tenue); }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 1.5rem; background: var(--navy); color: #fff; }
.login img { width: 190px; margin: 0 auto 1.8rem; display: block; }
.login form { background: #fff; color: var(--texto); border-radius: 18px; padding: 1.4rem; max-width: 420px; width: 100%; margin: 0 auto; }
.login h1 { margin-top: 0; }
.login .version { text-align: center; font-size: .75rem; color: rgba(255,255,255,.5); margin-top: 1.2rem; }

.vacio { text-align: center; color: var(--tenue); padding: 2.5rem 1rem; }
.vacio svg { width: 54px; height: 54px; opacity: .45; margin-bottom: .4rem; }
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + var(--seguro-abajo)); transform: translateX(-50%); z-index: 50; background: var(--navy); color: #fff; padding: .75rem 1.1rem;
  border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(5,22,61,.3); max-width: 92vw; }
.toast.mal { background: var(--mal); }
.menu { position: fixed; inset: 0; z-index: 30; background: rgba(5,22,61,.45); display: flex; align-items: flex-start; justify-content: flex-end; }
.menu > div { background: #fff; margin: calc(60px + var(--seguro-arriba)) .6rem 0 0; border-radius: 14px; min-width: 240px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.menu .quien { padding: .9rem 1rem; border-bottom: 1px solid var(--borde); }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: .9rem 1rem; font-weight: 600; }
.menu button:active { background: #f2f4f8; }
.cargando { text-align: center; padding: 3rem 1rem; color: var(--tenue); }
