/* Portal de fotos HormitecFoto — sobre la base visual de mantenimiento */
.app.portal { max-width: 1200px; }
.portal .main { padding: 18px 16px; }
.portal .page-title { margin-bottom: 12px; }
.header .salir { font-size: .9rem; padding: 6px 10px; color: inherit; min-height: 0; }

.tabs { display: flex; gap: 6px; margin: 0 0 12px; background: var(--surface-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.tab { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .92rem; padding: 10px 6px; border-radius: 9px; cursor: pointer; min-height: 42px; }
.tab.active { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }

.filtros { margin-bottom: 8px; }
.filtro-busca { display: flex; gap: 8px; }
.filtro-busca input { flex: 1; min-width: 0; }
.btn-filtros { flex: 0 0 auto; border: 1px solid var(--border-strong); background: var(--surface-elevated); color: var(--text); border-radius: var(--radius); font: inherit; font-weight: 700; padding: 0 14px; cursor: pointer; min-height: 48px; }
.btn-filtros[aria-expanded="true"] { border-color: var(--red-brand); }
#f-n { color: var(--red-brand); }
.filtros-mas { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-elevated); }
.filtros-mas .field-row { gap: 10px; }
.filtros-mas .field { margin-bottom: 10px; min-width: 0; }
.filtros-mas .field[hidden] { display: none; }
.filtros-mas select, .filtros-mas input { width: 100%; }
#f-limpiar { padding: 4px 0; }
.info { margin: 6px 0 10px; font-size: .88rem; }

.grupo-tit { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; font-weight: 700; display: flex; gap: 6px; align-items: baseline; }
.grupo-tit span { background: var(--surface-elevated); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; }
@media (min-width: 700px) { .grilla { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } }
.tile { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-elevated); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.tile:focus-visible { outline: 2px solid var(--red-brand); outline-offset: 2px; }
.tile-img { position: relative; aspect-ratio: 2 / 3; background: #111; display: block; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-img .hf-fase { position: absolute; left: 4px; top: 4px; font-size: .62rem; }
.tile-hora { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.62); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.tile-pie { padding: 5px 6px 6px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tile-pie b { font-size: .74rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile-pie span { font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver-mas { margin-top: 14px; }
.vacio { color: var(--muted); padding: 24px 4px; text-align: center; }

.mapa-portal { height: calc(100dvh - 300px); min-height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.pares-gal { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pares-gal .hf-gal-item { background: var(--surface-elevated); border-color: var(--border); color: var(--text); }
.pares-gal figcaption span { color: var(--muted); }
.pares-gal .par-grupo { color: var(--text) !important; font-weight: 600; }
.pares-gal .hf-gal-links a { color: var(--red-dim); }

.pie { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--muted); }
.pie-drive { color: var(--red-dim); font-weight: 700; text-decoration: none; font-size: .92rem; }

/* visor */
html.visor-abierto, html.visor-abierto body { overflow: hidden; }
.visor { position: fixed; inset: 0; z-index: 2000; background: #000; color: #f4f4f4; display: flex; flex-direction: column; overflow: hidden; }
.visor[hidden] { display: none; }
.visor-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: calc(8px + var(--safe-top)) 10px 8px; background: linear-gradient(rgba(0,0,0,.7), transparent); }
.visor-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.2rem; cursor: pointer; }
.visor-pos { font-weight: 700; font-size: .9rem; }
.visor-pista { flex: 1; min-height: 0; display: flex; transform: translateX(-100%); transition: transform .25s ease; touch-action: pan-y; user-select: none; }
.visor-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.visor-slide img { max-width: 100%; max-height: 100%; object-fit: contain; background-size: contain; background-repeat: no-repeat; background-position: center; pointer-events: none; }
.visor-flecha { position: absolute; top: 40%; z-index: 3; width: 44px; height: 64px; border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 2rem; cursor: pointer; border-radius: 10px; }
.visor-flecha.izq { left: 6px; } .visor-flecha.der { right: 6px; }
.visor-flecha[hidden] { display: none; }
@media (hover: none) { .visor-flecha { display: none; } }
.visor-datos { flex: 0 0 auto; max-height: 44%; overflow-y: auto; background: #151515; border-top: 2px solid #D2222A; padding: 12px 16px calc(14px + var(--safe-bottom)); font-size: .88rem; }
.visor.sin-info .visor-datos { display: none; }
.vd-tit { font-size: 1rem; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.visor-datos dl { display: grid; grid-template-columns: 7.2em 1fr; gap: 5px 10px; margin: 0 0 12px; }
.visor-datos dt { color: #9a9a9a; }
.visor-datos dd { margin: 0; word-break: break-word; }
.visor-datos small { color: #9a9a9a; }
.visor-datos a { color: #ff7b7f; }
.vd-acciones { display: flex; gap: 8px; }
.vd-acciones .vd-btn { flex: 1; min-height: 46px; line-height: 46px; margin: 0; font-size: .92rem; }
.visor .btn-secondary { background: #2a2a2a; color: #fff; border-color: #444; }
.visor .btn-primary { background: #E31F26; color: #fff; }

/* por origen */
.tab { font-size: .86rem; padding: 10px 4px; }
.migas { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .9rem; margin: 2px 0 8px; min-height: 24px; }
.migas a { color: var(--red-dim); font-weight: 700; text-decoration: none; padding: 4px 0; }
.migas a:hover { text-decoration: underline; }
.migas b { font-weight: 700; overflow-wrap: anywhere; }
.miga-sep { color: var(--muted); }
.carpetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
@media (min-width: 700px) { .carpetas { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; } }
.carpeta { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-elevated); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.carpeta:focus-visible { outline: 2px solid var(--red-brand); outline-offset: 2px; }
.carpeta-img { position: relative; aspect-ratio: 4 / 3; background: #1a1a1a; display: flex; align-items: center; justify-content: center; }
.carpeta-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carpeta.vacia { border-style: dashed; }
.carpeta.vacia .carpeta-img { background: var(--surface); }
.carpeta-icono { font-size: 2.6rem; opacity: .55; }
.carpeta-pie { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.carpeta-pie b { font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.carpeta-ic { font-size: .9rem; }
.carpeta-sub { font-size: .74rem; color: var(--muted); line-height: 1.25; }
.carpeta-n { font-size: .78rem; color: var(--text); margin-top: 3px; line-height: 1.35; }
.carpeta.vacia .carpeta-n { color: var(--muted); }
.subtabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.subtab { flex: 1; border: 1px solid var(--border-strong); background: var(--surface-elevated); color: var(--text); border-radius: 999px; font: inherit; font-weight: 700; font-size: .84rem; padding: 7px 6px; cursor: pointer; min-height: 38px; }
.subtab span { color: var(--muted); font-weight: 600; margin-left: 2px; }
.subtab.active { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: transparent; }
.subtab.active span { color: inherit; opacity: .75; }
.galeria-carpeta .grupo-tit:first-child { margin-top: 4px; }
.mapa-carpeta { height: calc(100dvh - 330px); }
/* zoom del visor */
.visor-pista { touch-action: none; }
.visor-top-der { display: flex; gap: 8px; }
.visor-slide { overflow: hidden; }
.visor.zoom .visor-flecha { display: none; }
.visor.zoom #visor-zoom-btn { background: #E31F26; }

/* acciones, selección e informe */
.acciones-fila { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.acc { border: 1px solid var(--border-strong); background: var(--surface-elevated); color: var(--text); border-radius: 10px; font: inherit; font-weight: 700; font-size: .85rem; padding: 7px 12px; cursor: pointer; min-height: 38px; }
.acc.on { border-color: var(--red-brand); color: var(--red-dim); }
.tile { position: relative; }
.tile.sel { outline: 3px solid var(--red-brand); outline-offset: -3px; }
.tile.sel::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; background: #E31F26; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.barra-sel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; display: flex; align-items: center; gap: 8px; padding: 10px 14px calc(10px + var(--safe-bottom)); background: var(--surface-elevated); border-top: 2px solid var(--red-brand); box-shadow: 0 -4px 18px rgba(0,0,0,.18); }
.barra-sel[hidden] { display: none; }
.barra-sel #sel-n { flex: 1; font-weight: 700; font-size: .9rem; }
.barra-sel .barra-btn { width: auto; min-height: 42px; padding: 0 14px; margin: 0; font-size: .9rem; }
body.con-barra .main { padding-bottom: 90px; }
.capa { position: fixed; inset: 0; z-index: 2100; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.capa[hidden] { display: none; }
.capa-caja { width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; background: var(--surface-elevated); color: var(--text); border-radius: 16px 16px 0 0; padding: 18px 16px calc(16px + var(--safe-bottom)); }
@media (min-width: 700px) { .capa { align-items: center; } .capa-caja { border-radius: 16px; } }
.capa-caja h2 { margin: 0 0 6px; font-size: 1.15rem; }
.capa-caja .field { margin-bottom: 10px; min-width: 0; }
.capa-caja .field-row { gap: 10px; }
.capa-caja input[type=text], .capa-caja input[type=date], .capa-caja select { width: 100%; }
.check { text-transform: none; letter-spacing: 0; font-weight: 600; display: flex; gap: 8px; align-items: center; font-size: .92rem; margin: 4px 0 8px; }
.check input { width: 20px; height: 20px; }
.inf-prog { font-weight: 600; color: var(--text); }
.capa-acciones { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.capa-acciones > * { flex: 1; margin: 0; min-height: 46px; text-align: center; }
.capa-acciones[hidden] { display: none; }
.capa-acciones a.btn-primary { line-height: 46px; text-decoration: none; }

/* links compartidos */
.vd-acciones .vd-btn-icono { flex: 0 0 52px; padding: 0; }
.pie-links { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; font-size: .92rem; color: var(--red-dim); text-align: left; cursor: pointer; }
.lk { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.lk b { overflow-wrap: anywhere; }
.lk .meta { margin: 0; font-size: .8rem; }
.lk-acc { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lk-acc .acc { font-size: .8rem; padding: 5px 10px; min-height: 34px; text-decoration: none; display: inline-flex; align-items: center; }
.lk-revocar { color: var(--red-dim); }
.lk.revocado { opacity: .6; }
#cmp-url { width: 100%; font-size: .85rem; }
.compartido .page-title h1 { overflow-wrap: anywhere; }

/* línea de tiempo */
.subtabs { overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtab { flex: 0 0 auto; white-space: nowrap; padding: 7px 12px; font-size: .82rem; }
.tl-barra { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.acc:disabled { opacity: .5; cursor: default; }
.tl { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border-strong); }
.tl-dia { position: relative; margin: 0 0 14px; }
.tl-punto { position: absolute; left: -17px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--red-brand); border: 2px solid var(--bg, #fff); box-sizing: content-box; }
.tl-cab { display: flex; flex-direction: column; margin-bottom: 6px; }
.tl-cab b { font-size: .92rem; }
.tl-cab b::first-letter { text-transform: uppercase; }
.tl-cab span { font-size: .78rem; color: var(--muted); }
.tl-fotos { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tl-hueco { margin: -6px 0 10px -18px; padding-left: 18px; font-size: .74rem; color: var(--muted); font-style: italic; position: relative; }
.cmp-panel { border: 1px solid var(--border); background: var(--surface-elevated); border-radius: 12px; padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.cmp-lado label { font-size: .74rem; text-transform: uppercase; color: var(--muted); font-weight: 700; display: block; margin-bottom: 4px; }
.cmp-lado select { width: 100%; }
.cmp-tira { display: flex; gap: 6px; overflow-x: auto; margin-top: 6px; }
.cmp-mini { flex: 0 0 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #111; position: relative; cursor: pointer; }
.cmp-mini.on { border-color: var(--red-brand); }
.cmp-mini img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.cmp-mini span { position: absolute; bottom: 2px; right: 2px; background: rgba(0,0,0,.65); color: #fff; font-size: .62rem; padding: 0 3px; border-radius: 4px; }
.cmp-panel .btn-primary { margin: 0; }
.hf-fase.cmp-fecha { background: rgba(0,0,0,.72); color: #fff; }

/* etiquetas y comentarios */
.tile-marcas { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 3px; align-items: center; }
.tile-marcas i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; display: block; }
.tile-marcas b { background: rgba(0,0,0,.62); color: #fff; font-size: .66rem; padding: 0 4px; border-radius: 6px; font-weight: 700; }
.vd-notas { border-top: 1px solid #333; padding-top: 10px; margin-bottom: 12px; }
.vd-sec { color: #9a9a9a; font-size: .74rem; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; margin: 4px 0 6px; }
.etiq-fila { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.etiq { border: 1.5px solid var(--c); background: transparent; color: #eee; border-radius: 999px; font: inherit; font-size: .8rem; font-weight: 700; padding: 5px 11px; cursor: pointer; min-height: 34px; }
.etiq.on { background: var(--c); color: #fff; }
.com { background: #222; border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; }
.com-cab { font-size: .76rem; color: #aaa; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.com-cab b { color: #eee; }
.com-borrar { margin-left: auto; background: none; border: 0; color: #ff7b7f; font: inherit; font-size: .74rem; cursor: pointer; padding: 2px 4px; }
.com-txt { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.com-vacio { color: #888; font-size: .82rem; margin: 0 0 6px; }
.com-form { display: flex; gap: 6px; align-items: flex-end; margin-top: 6px; }
.com-form textarea { flex: 1; min-width: 0; background: #1f1f1f; color: #f4f4f4; border: 1px solid #444; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .88rem; resize: vertical; }
.com-form .btn-primary { width: auto; margin: 0; min-height: 44px; padding: 0 14px; background: #E31F26; color: #fff; font-size: .88rem; }
.visor-datos { max-height: 50%; }

/* checklists con fotos obligatorias */
.tile-marcas b.tile-ck { background: #1E8E3E; }
.cks { display: flex; flex-direction: column; gap: 12px; }
.ck-card { border: 1.5px solid #d9a400; border-radius: 12px; padding: 10px 12px; background: var(--card, rgba(127,127,127,.06)); }
.ck-card.ok { border-color: #1E8E3E; }
.ck-cab { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ck-estado { font-size: .8rem; font-weight: 700; color: #b07d00; }
.ck-card.ok .ck-estado { color: #1E8E3E; }
.ck-sub { font-size: .78rem; opacity: .7; margin: 2px 0 8px; }
.ck-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ck-items li { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.ck-check { flex: 0 0 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; background: rgba(179,38,30,.15); color: #b3261e; }
.ck-items li.ok .ck-check { background: #1E8E3E; color: #fff; }
.ck-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.ck-nom small { font-size: .74rem; opacity: .7; }
.ck-mini { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; overflow: hidden; width: 40px; height: 52px; flex: 0 0 auto; }
.ck-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ck-sin { font-size: .75rem; opacity: .6; }

/* foto que abre un pedido */
.tile-marcas b.tile-ped { background: #D2222A; }
.vd-pedido { margin: 6px 0 10px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #d9822b; font-size: .88rem; line-height: 1.35; }
.vd-pedido-seg { border-color: #D2222A; background: rgba(210,34,42,.08); }
.vd-pedido-prob { background: rgba(217,130,43,.08); }
.vd-pedido a { font-weight: 700; word-break: break-word; }
.vd-pedido .btn-secondary { margin-left: 6px; padding: 6px 10px; min-height: 36px; }
.vd-pedido-ayuda { margin: 4px 0 8px; font-size: .78rem; opacity: .75; }
.aviso-flot { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3000; max-width: calc(100vw - 32px); background: #1f1f1f; color: #fff; padding: 10px 14px; border-radius: 12px; font-size: .9rem; box-shadow: 0 6px 24px rgba(0,0,0,.35); }

/* portal de clientes */
.cliente .cl-codigo { max-width: 420px; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.cliente .cl-cod-fila { display: flex; gap: 8px; }
.cliente .cl-cod-fila input { flex: 1; text-transform: uppercase; letter-spacing: .12em; font-size: 1.1rem; }
.cliente .cl-tabs { margin: 6px 0 8px; }
.cliente .acciones { margin: 6px 0; }

.clf .radio { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; margin: 4px 0; font-weight: 400; text-transform: none; letter-spacing: 0; }
.clf .radio input { margin-top: 3px; }
#cl-lista .lk { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
#cl-lista .cl-modo { margin: 6px 0; width: 100%; }
#cl-lista .lk-acc { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#cl-lista .lk-url { flex: 1 1 100%; font-size: .75rem; word-break: break-all; }
.vis-cli { margin: 0 0 8px; }
