/* ══ Marco del iPhone (402 × 874, como en Figma) ─────────────── */
.device-scale { position: relative; }
.device { width: 424px; height: 896px; padding: 11px; border-radius: 58px; background: #0A111C; box-shadow: 0 0 0 1.5px #2a3444, 0 50px 90px -40px rgba(8, 20, 40, .55), 0 20px 40px -24px rgba(8, 20, 40, .4); transform-origin: top center; }
.scr { position: relative; width: 402px; height: 874px; border-radius: 47px; overflow: hidden; background: var(--lienzo); color: var(--tx); isolation: isolate; font-family: var(--f); }
.scr.white { background: var(--base); }
.scr.dark { background: #05070C; }

/* barra de estado e indicador de inicio */
.sb { position: absolute; inset: 0 0 auto; height: 54px; z-index: 80; pointer-events: none; color: var(--tx); }
.sb.dark { color: #fff; }
.sb .time { position: absolute; left: 52px; top: 17px; font: 700 17px/22px var(--f); }
.sb .island { position: absolute; left: 139px; top: 11px; width: 124px; height: 36px; border-radius: 18px; background: #000; }
.sb .sys { position: absolute; right: 30px; top: 22px; }
.hi { position: absolute; left: 131px; bottom: 8px; width: 140px; height: 5px; border-radius: 3px; background: var(--tx); z-index: 80; pointer-events: none; }
.hi.dark { background: #fff; }

/* vistas */
.view { position: absolute; inset: 0; }
.body { position: absolute; inset: 54px 0 0; overflow-y: auto; padding: 6px 20px 150px; scrollbar-width: none; }
.body::-webkit-scrollbar { display: none; }
.col { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* encabezado */
.m-head { display: flex; align-items: center; gap: 8px; }
.m-head .grow { display: grid; gap: 2px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; display: grid; place-items: center; background: var(--base); color: var(--tx); position: relative; flex: none; }
.icon-btn.sq { border-radius: 14px; }
.icon-btn.sunk { background: var(--hundida); }
.icon-btn .dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--error); box-shadow: 0 0 0 2px var(--base); }
.top-bar { position: absolute; left: 20px; right: 20px; top: 58px; height: 44px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; z-index: 5; }
.top-bar .t-s { text-align: center; }

/* tarjeta del día */
.day { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; border-radius: 26px; background: var(--grad); color: #fff; box-shadow: var(--sh-tarjeta); }
.day .grow { display: grid; gap: 12px; }
.ov { font: 700 11px/14px var(--f); letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 0; color: #fff; justify-self: start; }
.knob { width: 30px; height: 18px; border-radius: 9px; background: var(--exito); position: relative; transition: background .2s; }
.knob::after { content: ""; position: absolute; top: 2px; left: 14px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .2s; }
.live.off .knob { background: rgba(255, 255, 255, .3); }
.live.off .knob::after { left: 2px; }

/* bidón */
.bottle { display: block; flex: none; overflow: visible; }
.bottle .w1 { animation: wave 3.6s linear infinite; }
.bottle .w2 { animation: wave 5.4s linear infinite reverse; }
.bottle .water { transition: transform 1.2s cubic-bezier(.3, .8, .2, 1); }
@keyframes wave { to { transform: translateX(-20px); } }

/* sección */
.sec-h { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 -4px; }

/* tarjeta del siguiente pedido */
.card { background: var(--base); border-radius: 26px; box-shadow: var(--sh-tarjeta); }
.next { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(10px); opacity: .3; } }
.tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.addr { display: flex; gap: 8px; color: var(--primario); }
.addr > div { display: grid; gap: 2px; }
.prods { background: var(--lienzo); border-radius: 18px; padding: 8px 12px 8px 8px; display: grid; gap: 8px; }
.prods .it { display: flex; align-items: center; gap: 12px; }
.prods .prod { width: 48px; height: 48px; }
.prods .it > div { display: grid; gap: 2px; }
.hr { height: 1px; background: var(--borde); }
.pay { display: flex; align-items: flex-end; justify-content: space-between; }
.acts { display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.go-btn { height: 64px; border-radius: 20px; border: 0; background: var(--base); box-shadow: inset 0 0 0 1.5px var(--borde); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--primario); }
.link { border: 0; background: none; color: var(--tx3); font: 500 13px/18px var(--f); text-decoration: underline; text-underline-offset: 3px; padding: 2px 6px; align-self: center; }

/* deslizar para entregar */
.swipe { position: relative; height: 64px; border-radius: 20px; background: linear-gradient(135deg, #4C74FF, #2747C8); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.swipe .fill { position: absolute; inset: 0 auto 0 0; width: 64px; background: var(--exito); transition: width .28s cubic-bezier(.2, .8, .2, 1); }
.swipe .lab { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding-left: 52px; color: #fff; font: 700 16px/20px var(--f); opacity: calc(1 - var(--p, 0) * 1.6); pointer-events: none; }
.swipe .lab .ic { opacity: .5; }
.swipe .thumb { position: absolute; left: 6px; top: 6px; width: 52px; height: 52px; border-radius: 15px; border: 0; background: #fff; color: var(--primario); display: grid; place-items: center; cursor: grab; transition: transform .28s cubic-bezier(.2, .8, .2, 1); touch-action: none; }
.swipe.drag .thumb, .swipe.drag .fill { transition: none; }
.swipe.ok .thumb { color: var(--exito); }
.swipe.nudge .thumb { animation: nudge .5s ease; }
@keyframes nudge { 35% { transform: translateX(26px); } 70% { transform: translateX(-3px); } }

/* fila de pedido */
.frow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border: 0; border-radius: 18px; background: var(--base); text-align: left; color: var(--tx); }
.frow .n { width: 36px; height: 36px; border-radius: 12px; background: var(--hundida); display: grid; place-items: center; font: 700 14px/18px var(--f); color: var(--tx2); flex: none; }
.frow .n.ok { background: var(--exito-suave); color: var(--exito); }
.frow .n.err { background: var(--error-suave); color: var(--error); }
.frow .grow { display: grid; gap: 2px; }
.frow .rt { display: grid; gap: 4px; justify-items: end; flex: none; }
.zone-h { display: flex; justify-content: space-between; margin: 4px 4px -6px; }
details.done > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 4px; }
details.done > summary::-webkit-details-marker { display: none; }
details.done[open] > summary .ic { transform: rotate(180deg); }
details.done .col { gap: 8px; margin-top: 8px; }

/* barra inferior del chofer */
.fade { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(to bottom, rgba(244, 246, 251, 0), rgba(244, 246, 251, 1) 45%); pointer-events: none; z-index: 20; }
.tabbar { position: absolute; left: 22px; bottom: 36px; width: 358px; height: 62px; display: flex; gap: 8px; z-index: 30; }
.tabbar .tabs { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; border-radius: 24px; background: var(--profundo); box-shadow: var(--sh-flotante); }
.tabbar .tabs button { border: 0; border-radius: 18px; background: none; color: rgba(255, 255, 255, .6); display: grid; place-items: center; align-content: center; gap: 3px; font: 600 12px/16px var(--f); }
.tabbar .tabs button[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.tabbar .fab { border: 0; border-radius: 24px; padding: 0 18px 0 16px; display: flex; align-items: center; gap: 6px; background: var(--grad-btn); color: #fff; font: 700 14px/18px var(--f); box-shadow: var(--sh-primario); }

/* aviso emergente (toast) */
.toast { position: absolute; left: 22px; right: 22px; bottom: 112px; z-index: 70; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px; background: var(--profundo); color: #fff; box-shadow: var(--sh-flotante); transform: translateY(16px); opacity: 0; transition: .28s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.toast.show { transform: none; opacity: 1; }
.toast.low { bottom: 40px; }
.toast .ti { width: 32px; height: 32px; border-radius: 10px; background: var(--exito); display: grid; place-items: center; flex: none; }

/* aviso superior de pedido cercano */
.banner { position: absolute; left: 12px; right: 12px; top: 54px; z-index: 65; display: grid; gap: 12px; padding: 16px; border-radius: 24px; background: var(--profundo); color: #fff; box-shadow: var(--sh-flotante); transform: translateY(calc(-100% - 80px)); visibility: hidden; transition: transform .45s cubic-bezier(.2, .9, .25, 1.1), visibility 0s linear .45s; }
.banner.show { transform: none; visibility: visible; transition: transform .45s cubic-bezier(.2, .9, .25, 1.1); }
.banner .b-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.banner .b-acts button { height: 48px; border: 0; border-radius: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; font: 700 14px/18px var(--f); }
.banner .no { background: rgba(255, 255, 255, .1); color: #fff; }
.banner .yes { background: var(--cielo); color: var(--profundo); }

/* hoja inferior */
.scrim { position: absolute; inset: 0; z-index: 50; background: rgba(15, 26, 58, .45); opacity: 0; transition: opacity .22s; border: 0; width: 100%; padding: 0; cursor: default; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--base); border-radius: 32px 32px 0 0; padding: 12px 20px 46px; display: flex; flex-direction: column; gap: 16px; transform: translateY(103%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); max-height: 90%; overflow-y: auto; scrollbar-width: none; }
.scr.sheet-open .scrim { opacity: 1; }
.scr.sheet-open .sheet { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--borde); align-self: center; flex: none; }
.kick { display: flex; align-items: center; gap: 6px; }
.total-box { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 18px; background: var(--lienzo); }
.tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ptile { border: 0; border-radius: 22px; padding: 16px; background: var(--base); box-shadow: inset 0 0 0 1.5px var(--borde); display: flex; flex-direction: column; gap: 14px; text-align: left; color: var(--tx); transition: transform .12s; }
.ptile:active { transform: scale(.98); }
.ptile.on { background: var(--primario-suave); box-shadow: inset 0 0 0 2px var(--primario); }
.ptile .top { display: flex; align-items: center; justify-content: space-between; }
.ptile > div { display: grid; gap: 2px; }
.wtile { border: 0; border-radius: 20px; padding: 12px 14px; background: var(--base); box-shadow: inset 0 0 0 1.5px var(--borde); display: flex; align-items: center; gap: 12px; text-align: left; color: var(--tx); }
.wtile > div { flex: 1; display: grid; gap: 1px; }
.reasons { display: grid; gap: 8px; }
.reasons button { height: 54px; border: 0; border-radius: 18px; padding: 0 14px 0 16px; background: var(--base); box-shadow: inset 0 0 0 1.5px var(--borde); display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 16px/22px var(--f); color: var(--tx); text-align: left; }
.reasons button small { display: block; font: 500 13px/18px var(--f); color: var(--tx3); }
.chips4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chips4 button { height: 56px; border: 0; border-radius: 16px; background: var(--base); box-shadow: inset 0 0 0 1.5px var(--borde); font: 700 16px/20px var(--f); color: var(--tx); }
.chips4 button.on { background: var(--profundo); color: #fff; box-shadow: none; }
.amount { font: 800 44px/48px var(--f); letter-spacing: -.03em; text-align: center; font-variant-numeric: tabular-nums; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 54px; border: 0; border-radius: 16px; background: var(--hundida); font: 700 22px/1 var(--f); color: var(--tx); display: grid; place-items: center; }

/* acceso */
.hero-in { position: absolute; inset: 0 0 auto; height: 400px; background: linear-gradient(to bottom, #E9EEFF, #FFFFFF); }
.hero-in .halo { position: absolute; left: 41px; top: 70px; width: 320px; height: 320px; border-radius: 50%; background: #DCE5FF; }
.hero-in .plate { position: absolute; left: 83px; top: 112px; width: 236px; height: 236px; border-radius: 50%; background: #fff url(../assets/bidon.webp) center/cover; box-shadow: var(--sh-flotante); }
.brand-m { position: absolute; left: 24px; top: 66px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.iso { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--grad-btn); color: #fff; flex: none; }
.in-body { position: absolute; left: 24px; right: 24px; top: 424px; display: flex; flex-direction: column; gap: 20px; }
.otp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.otp div { height: 76px; border-radius: 18px; background: var(--hundida); display: grid; place-items: center; font: 800 30px/36px var(--f); color: var(--tx); }
.otp div.focus { background: var(--base); box-shadow: inset 0 0 0 2px var(--primario), 0 0 0 4px rgba(61, 99, 240, .16); }
.otp div.focus::after { content: ""; width: 2px; height: 30px; background: var(--primario); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.role-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--primario-suave); color: var(--primario); }
.role-card > div { flex: 1; display: grid; gap: 2px; }
.ios-kb { position: absolute; left: 0; right: 0; bottom: 0; height: 300px; background: #D4D9E2; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 52px; gap: 8px 4px; padding: 8px 6px 0; }
.ios-kb button { border: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .25); display: grid; place-items: center; align-content: center; color: #000; font: 500 25px/1 var(--f); }
.ios-kb button small { font: 600 10px/1.1 var(--f); letter-spacing: .12em; }
.ios-kb button.clear { background: none; box-shadow: none; }

/* mapa y navegación */
.map-bg { position: absolute; inset: 0; background: #EEF0EC url(../assets/mapa.webp) center/cover; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pin-tag { position: absolute; padding: 6px 10px; border-radius: 10px; background: #fff; box-shadow: var(--sh-tarjeta); font: 600 12px/16px var(--f); color: var(--tx); white-space: nowrap; }
.truck-dot { position: absolute; width: 38px; height: 38px; border-radius: 50%; background: var(--profundo); border: 3px solid #fff; display: grid; place-items: center; color: #fff; transform: translate(-50%, -50%); z-index: 3; }
.truck-dot::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; background: rgba(61, 99, 240, .18); z-index: -1; animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
.nav-ins { position: absolute; left: 14px; top: 58px; width: 310px; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 22px; background: var(--profundo); color: #fff; box-shadow: var(--sh-flotante); z-index: 5; }
.nav-ins .tile-ic { width: 48px; height: 48px; background: rgba(255, 255, 255, .12); color: var(--cielo); }
.float-btn { position: absolute; width: 50px; height: 50px; border-radius: 16px; border: 0; background: #fff; box-shadow: var(--sh-tarjeta); display: grid; place-items: center; color: var(--tx); z-index: 5; }
.float-btn.round { border-radius: 25px; width: 48px; height: 48px; color: var(--primario); }
.dest-card { position: absolute; left: 12px; right: 12px; bottom: 40px; padding: 18px 18px 16px; border-radius: 28px; background: #fff; box-shadow: var(--sh-flotante); display: flex; flex-direction: column; gap: 14px; z-index: 5; }
.dest-card .acts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gm-link { align-self: center; display: inline-flex; align-items: center; gap: 6px; color: var(--primario); font: 600 12px/16px var(--f); text-decoration: none; }
.map-head { position: absolute; left: 12px; right: 12px; top: 58px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 20px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); box-shadow: var(--sh-tarjeta); }

/* cámara */
.cam-top { position: absolute; left: 16px; right: 16px; top: 60px; height: 44px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; color: #fff; z-index: 3; }
.cam-top .icon-btn { background: rgba(255, 255, 255, .14); color: #fff; }
.viewfinder { position: absolute; left: 16px; top: 120px; width: 370px; height: 560px; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 50% 45%, #2B3442 0%, #0B0F16 75%); display: grid; place-items: center; }
.viewfinder.photo { background-size: cover; background-position: center; }
.viewfinder .guides { position: absolute; left: 35px; top: 70px; }
.receipt { width: 236px; border-radius: 20px; background: #fff; overflow: hidden; transform: rotate(3deg); box-shadow: 0 24px 48px rgba(0, 0, 0, .45); color: var(--tx); }
.receipt .rh { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--yape); color: #fff; }
.receipt .rb { display: grid; gap: 4px; padding: 14px 16px 16px; }
.cam-hint { position: absolute; left: 0; right: 0; top: 700px; text-align: center; color: rgba(255, 255, 255, .7); }
.shutter { position: absolute; left: 155px; top: 736px; width: 92px; height: 92px; border-radius: 50%; border: 3px solid #fff; background: transparent; padding: 3px; }
.shutter::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active::after { transform: scale(.92); }
.flash { animation: flash .45s ease; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 1000px rgba(255, 255, 255, .95); } 100% { box-shadow: inset 0 0 0 1000px rgba(255, 255, 255, 0); } }

/* caja */
.cash-hero { position: relative; overflow: hidden; display: grid; gap: 4px; padding: 20px 20px 34px; border-radius: 28px; background: var(--grad); color: #fff; box-shadow: var(--sh-tarjeta); }
.cash-hero svg.waves { position: absolute; left: 0; bottom: 0; width: 100%; height: 40px; }
.ledger { background: var(--base); border-radius: 22px; overflow: hidden; }
.ledger .li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--borde); }
.ledger .li.tot { border-bottom: 0; background: var(--primario-suave); padding: 14px 16px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px; background: var(--base); }
.mini-row > div { flex: 1; display: grid; gap: 1px; }

/* almacén */
.alm-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; border-radius: 30px; background: var(--base); box-shadow: var(--sh-tarjeta); text-align: center; }
.mov { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border: 0; border-radius: 20px; background: var(--base); text-align: left; color: var(--tx); }
.mov .ph { width: 60px; height: 60px; border-radius: 14px; background: #1F252D center/cover; flex: none; }
.mov > div { flex: 1; display: grid; gap: 4px; justify-items: start; }
.info-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--primario-suave); color: var(--primario); }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 20px; background: var(--base); }
.prow .prod { width: 48px; height: 48px; }
.prow > div:nth-child(2) { flex: 1; display: grid; gap: 2px; min-width: 0; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 42px; height: 46px; border-radius: 13px; border: 0; background: var(--hundida); color: var(--tx); display: grid; place-items: center; }
.stepper .val { width: 58px; height: 50px; border-radius: 14px; background: var(--base); box-shadow: inset 0 0 0 1.5px var(--borde); font: 800 20px/26px var(--f); color: var(--tx); font-variant-numeric: tabular-nums; }
.photo-card { position: relative; border-radius: 22px; overflow: hidden; background: #1F252D center/cover; }
.photo-card .stamp { position: absolute; left: 12px; top: 12px; padding: 4px 8px; border-radius: 8px; background: rgba(15, 26, 58, .7); color: #fff; font: 500 12px/16px var(--mono); }
.photo-card .redo { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 12px; background: rgba(15, 26, 58, .78); color: #fff; font: 600 12px/16px var(--f); }
.shot-empty { height: 120px; border: 2px dashed #B9C9F7; border-radius: 22px; background: var(--primario-suave); color: var(--primario); display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; width: 100%; }
.cmp { background: var(--base); border-radius: 22px; padding: 6px 16px; }
.cmp .r { display: grid; grid-template-columns: 1fr 52px 52px 44px; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--borde); }
.cmp .r.h { border-top: 0; padding: 8px 0; }
.cmp .r > :not(:first-child) { text-align: right; }
.cap { display: grid; gap: 8px; padding: 12px 14px; border-radius: 18px; background: var(--base); }
.cap .track { height: 8px; border-radius: 4px; background: var(--hundida); overflow: hidden; }
.cap .track i { display: block; height: 100%; border-radius: 4px; background: var(--primario); }
.res-ic { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; align-self: center; }
