:root {
  --azul: #2064B6; --azul-hondo: #174A8A; --tinta: #0F2540; --menta: #6DCCC3; --cian: #39ADD1;
  --gris: #DAE1E7; --bruma: #F3F6F9; --pizarra: #5B6B7C; --blanco: #fff;
  --ok: #1E8A5A; --ok-f: #E3F4EC; --alerta: #B86E00; --alerta-f: #FFF3DC; --error: #C2352B; --error-f: #FBE9E7; --wa: #1FA855;
  --radio: 16px; --radio-s: 11px; --sombra: 0 10px 30px -18px rgba(15,37,64,.45);
  --ancho: 760px; --nav: 68px; --cab: 58px;
  --seguro-b: env(safe-area-inset-bottom, 0px); --seguro-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Montserrat', system-ui, -apple-system, sans-serif; color: var(--tinta); background: var(--bruma); line-height: 1.45; font-size: 15px; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--azul); }
svg { display: block; flex: none; }
:focus-visible { outline: 3px solid var(--cian); outline-offset: 2px; }
.sim svg, .sim-grande svg { fill: currentColor; }
b, strong { font-weight: 700; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
html, body { overflow-x: hidden; }

/* ───── arranque y acceso ───── */
.arranque { min-height: 100dvh; display: grid; place-items: center; }
.acceso { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(600px 420px at 100% 0%, rgba(109,204,195,.35), transparent 70%), linear-gradient(160deg, var(--azul) 0%, var(--azul-hondo) 70%, var(--tinta) 100%); }
.acceso form { width: min(400px, 100%); background: #fff; border-radius: 22px; padding: 30px 22px 24px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }
.acceso .marca { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.acceso .marca .sim { width: 40px; color: var(--azul); }
.acceso .marca b { display: block; font-size: 17px; font-weight: 800; letter-spacing: .02em; }
.acceso .marca small { color: var(--pizarra); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.acceso h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.acceso p { color: var(--pizarra); font-size: 14px; margin: 6px 0 18px; }

/* ───── estructura ───── */
.cab { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: calc(var(--cab) + var(--seguro-t)); padding: var(--seguro-t) 12px 0;
  background: rgba(255,255,255,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--gris); }
.cab h1 { flex: 1; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab .logo { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; text-decoration: none; color: var(--tinta); }
.cab .logo .sim { width: 26px; color: var(--azul); }
.cab .logo span { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; white-space: nowrap; }
.cab .logo b { font-weight: 800; }
.btn-ico { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--tinta); flex: none; }
.btn-ico:hover { background: var(--bruma); }
.btn-ico svg { width: 22px; height: 22px; }
main.vista { max-width: var(--ancho); margin: 0 auto; padding: 16px 16px calc(var(--nav) + 28px + var(--seguro-b)); }

.nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav) + var(--seguro-b)); padding-bottom: var(--seguro-b); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--gris); }
.nav a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--pizarra); font-size: 11px; font-weight: 600; }
.nav a svg { width: 23px; height: 23px; }
.nav a.activo { color: var(--azul); }
.nav .mas-btn { flex: none; width: 74px; display: grid; place-items: center; }
.nav .mas-btn span { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--azul); color: #fff; box-shadow: 0 10px 22px -10px rgba(32,100,182,.9); }
.nav .mas-btn svg { width: 26px; height: 26px; }

/* ───── tipografía y bloques ───── */
.titulo-sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 2px 10px; }
.titulo-sec h2 { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pizarra); }
.titulo-sec a, .titulo-sec button { font-size: 13px; font-weight: 700; color: var(--azul); text-decoration: none; }
.saludo { margin: 4px 2px 14px; }
.saludo h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.saludo p { color: var(--pizarra); font-size: 14px; }
.tarjeta { background: #fff; border: 1px solid var(--gris); border-radius: var(--radio); padding: 16px; }
.tarjeta + .tarjeta { margin-top: 10px; }
.sub { color: var(--pizarra); font-size: 13px; }
.mini { font-size: 12px; color: var(--pizarra); }
.vacio { text-align: center; color: var(--pizarra); padding: 28px 16px; font-size: 14px; }
.vacio svg { width: 40px; height: 40px; margin: 0 auto 8px; color: var(--gris); }
.vacio .btn { margin-top: 14px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--gris); border-radius: var(--radio); padding: 14px; text-decoration: none; color: inherit; display: block; }
.kpi span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pizarra); }
.kpi b { display: block; margin-top: 4px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--tinta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.azul { background: var(--azul); border-color: var(--azul); }
.kpi.azul span, .kpi.azul b { color: #fff; }
.kpi.azul span { opacity: .8; }
@media (min-width: 620px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.atajos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.atajos a, .atajos button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: #fff; border: 1px solid var(--gris); text-decoration: none; color: var(--tinta); font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.2; }
.atajos svg { width: 22px; height: 22px; color: var(--azul); }

.alerta { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; font-size: 14px; margin-top: 10px; text-decoration: none; color: inherit; }
.alerta svg { width: 20px; height: 20px; margin-top: 1px; }
.alerta b { display: block; }
.alerta.error { background: var(--error-f); color: #7A1E16; }
.alerta.aviso { background: var(--alerta-f); color: #6B4100; }
.alerta.info { background: #E6F0FB; color: var(--azul-hondo); }
.alerta.ok { background: var(--ok-f); color: #145C3C; }

/* ───── listas ───── */
.lista { background: #fff; border: 1px solid var(--gris); border-radius: var(--radio); overflow: hidden; }
.fila { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-top: 1px solid var(--gris); width: 100%; text-align: left; background: #fff; }
.fila:first-child { border-top: 0; }
button.fila:hover, a.fila:hover { background: #FAFCFD; }
.fila .cuerpo { flex: 1; min-width: 0; }
.fila .cuerpo b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .cuerpo span { display: block; font-size: 13px; color: var(--pizarra); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .der { text-align: right; flex: none; font-size: 13px; }
.fila .der b { display: block; font-size: 15px; }
.fila .flecha { width: 18px; height: 18px; color: var(--gris); }
.avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #E6F0FB; color: var(--azul); font-weight: 800; font-size: 15px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.redondo { border-radius: 50%; }
.miniatura { width: 52px; height: 52px; border-radius: 10px; background: var(--bruma) center/cover no-repeat; flex: none; position: relative; display: grid; place-items: center; color: var(--pizarra); overflow: hidden; }
.miniatura svg { width: 20px; height: 20px; }
.miniatura .cuantos { position: absolute; right: 3px; top: 3px; background: rgba(15,37,64,.75); color: #fff; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 1px 5px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--bruma); color: var(--pizarra); white-space: nowrap; }
.chip.ok { background: var(--ok-f); color: var(--ok); }
.chip.aviso { background: var(--alerta-f); color: var(--alerta); }
.chip.error { background: var(--error-f); color: var(--error); }
.chip.azul { background: #E6F0FB; color: var(--azul); }
.chip.tinta { background: var(--tinta); color: #fff; }
.chip svg { width: 13px; height: 13px; }

.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 0 -16px 12px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtros button { flex: none; padding: 8px 14px; border-radius: 99px; background: #fff; border: 1.5px solid var(--gris); font-size: 13.5px; font-weight: 600; }
.filtros button.activo { background: var(--tinta); border-color: var(--tinta); color: #fff; }

.buscar { position: relative; margin-bottom: 12px; }
.buscar input { padding-left: 42px; }
.buscar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--pizarra); }

/* ───── formularios ───── */
.campo { display: block; margin-top: 14px; }
.campo:first-child { margin-top: 0; }
.campo > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--pizarra); margin-bottom: 6px; }
.campo > small { display: block; margin-top: 5px; font-size: 12px; color: var(--pizarra); }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=month], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: var(--radio-s); border: 1.5px solid var(--gris); background: #fff; font-size: 16px; outline: none; transition: border-color .15s; appearance: none; -webkit-appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B7C' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.alto { min-height: 220px; }
input:focus, select:focus, textarea:focus { border-color: var(--azul); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dos .campo, .tres .campo { margin-top: 14px; }
.dos > *, .tres > * { min-width: 0; }
input[type=date], input[type=datetime-local], input[type=month] { min-width: 0; max-width: 100%; }
.tres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; font-weight: 600; font-size: 14.5px; }
.interruptor input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--gris); position: relative; flex: none; transition: background .2s; cursor: pointer; }
.interruptor input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.interruptor input:checked { background: var(--azul); }
.interruptor input:checked::after { transform: translateX(20px); }
.contador { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--pizarra); font-weight: 600; }
.contador .mal { color: var(--error); }

.segmento { display: flex; background: var(--bruma); border: 1px solid var(--gris); border-radius: 13px; padding: 3px; gap: 3px; }
.segmento button { flex: 1; padding: 9px 6px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--pizarra); display: flex; align-items: center; justify-content: center; gap: 6px; }
.segmento button svg { width: 17px; height: 17px; }
.segmento button.activo { background: #fff; color: var(--tinta); box-shadow: 0 2px 6px -2px rgba(15,37,64,.25); }
.segmento.apilado button { flex-direction: column; gap: 3px; font-size: 12px; padding: 8px 2px; }
.segmento.apilado button svg { width: 20px; height: 20px; }
.segmento button { min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border-radius: 13px; font-weight: 700; font-size: 15px; text-decoration: none; border: 1.5px solid transparent; transition: transform .1s, background .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn svg { width: 19px; height: 19px; }
.btn.prim { background: var(--azul); color: #fff; }
.btn.prim:hover { background: var(--azul-hondo); }
.btn.sec { background: #fff; color: var(--tinta); border-color: var(--gris); }
.btn.sec:hover { border-color: var(--azul); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.peligro { background: #fff; color: var(--error); border-color: #F0C9C5; }
.btn.suave { background: #E6F0FB; color: var(--azul); }
.btn.chico { min-height: 36px; padding: 7px 12px; font-size: 13.5px; border-radius: 11px; }
.btn.bloque { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.botones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.botones .btn { flex: 1; }
main.vista:has(.barra-accion) { padding-bottom: calc(var(--nav) + var(--seguro-b) + 110px); }
.barra-accion { position: fixed; left: 50%; transform: translateX(-50%); width: min(calc(100% - 24px), calc(var(--ancho) - 24px)); bottom: calc(var(--nav) + var(--seguro-b) + 10px); z-index: 20; display: flex; gap: 10px; padding: 10px; background: rgba(255,255,255,.96); border: 1px solid var(--gris); border-radius: 18px; box-shadow: var(--sombra); backdrop-filter: blur(10px); }
.barra-accion .btn { flex: 1; }
.fab { text-decoration: none; position: fixed; right: max(16px, calc((100vw - var(--ancho)) / 2 + 16px)); bottom: calc(var(--nav) + var(--seguro-b) + 16px); z-index: 35; height: 54px; padding: 0 20px; border-radius: 18px; background: var(--tinta); color: #fff; display: flex; align-items: center; gap: 8px; font-weight: 700; box-shadow: 0 14px 28px -14px rgba(15,37,64,.8); }
.fab svg { width: 22px; height: 22px; }

.cargando { display: grid; place-items: center; padding: 50px 0; }
.rueda { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--gris); border-top-color: var(--azul); animation: girar .8s linear infinite; }
.rueda.blanca { border-color: rgba(255,255,255,.35); border-top-color: #fff; width: 18px; height: 18px; border-width: 2.5px; }
@keyframes girar { to { transform: rotate(360deg); } }
.esqueleto { height: 64px; border-radius: 14px; background: linear-gradient(90deg, #EBEFF3 0%, #F6F8FA 50%, #EBEFF3 100%); background-size: 200% 100%; animation: brillo 1.2s infinite; margin-bottom: 10px; }
@keyframes brillo { to { background-position: -200% 0; } }

/* ───── hoja inferior ───── */
#capa-hoja { position: fixed; inset: 0; z-index: 60; background: rgba(15,37,64,.45); display: flex; align-items: flex-end; justify-content: center; animation: aparecer .15s; }
@keyframes aparecer { from { opacity: 0; } }
.hoja { width: min(640px, 100%); max-height: 92dvh; display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; animation: subir .22s cubic-bezier(.2,.8,.2,1); }
@keyframes subir { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 700px) { #capa-hoja { align-items: center; } .hoja { border-radius: 22px; max-height: 86dvh; } }
.hoja-cab { display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; border-bottom: 1px solid var(--gris); }
.hoja-cab h3 { flex: 1; font-size: 17px; font-weight: 800; }
.hoja-cuerpo { padding: 16px 18px calc(18px + var(--seguro-b)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.opciones { display: grid; gap: 8px; }
.opcion { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--gris); background: #fff; text-align: left; width: 100%; text-decoration: none; color: inherit; }
.opcion:hover { border-color: var(--azul); }
.opcion .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #E6F0FB; color: var(--azul); flex: none; }
.opcion .ico svg { width: 22px; height: 22px; }
.opcion b { display: block; font-size: 15px; }
.opcion span { display: block; font-size: 13px; color: var(--pizarra); }

/* ───── avisos ───── */
#avisos { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); top: calc(12px + var(--seguro-t)); display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.aviso-t { background: var(--tinta); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: 0 16px 30px -16px rgba(0,0,0,.6); animation: bajar .2s; pointer-events: auto; }
.aviso-t.error { background: var(--error); }
.aviso-t.ok { background: var(--ok); }
@keyframes bajar { from { transform: translateY(-10px); opacity: 0; } }

/* ───── publicaciones ───── */
.pub-medios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.medio { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; background: var(--bruma) center/cover no-repeat; overflow: hidden; border: 1px solid var(--gris); }
.medio .acciones-m { position: absolute; inset: auto 4px 4px 4px; display: flex; justify-content: space-between; gap: 4px; }
.medio .acciones-m button { width: 30px; height: 30px; border-radius: 9px; background: rgba(15,37,64,.72); color: #fff; display: grid; place-items: center; }
.medio .acciones-m svg { width: 16px; height: 16px; }
.medio .num { position: absolute; left: 6px; top: 6px; background: rgba(15,37,64,.72); color: #fff; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 1px 6px; }
.medio .tipo-v { position: absolute; right: 6px; top: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.medio .tipo-v svg { width: 18px; height: 18px; }
.medio .progreso { position: absolute; inset: 0; background: rgba(255,255,255,.75); display: grid; place-items: center; align-content: center; gap: 8px; font-size: 12px; font-weight: 700; }
.medio .progreso i { display: block; width: 70%; height: 5px; border-radius: 9px; background: var(--gris); overflow: hidden; }
.medio .progreso i::after { content: ''; display: block; height: 100%; width: var(--p, 0%); background: var(--azul); transition: width .2s; }
.medio.falla .progreso { background: rgba(251,233,231,.92); color: var(--error); padding: 8px; text-align: center; }
.agregar-medio { aspect-ratio: 4 / 5; border-radius: 12px; border: 2px dashed #B9C6D2; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--azul); font-weight: 700; font-size: 13px; background: #fff; cursor: pointer; text-align: center; padding: 6px; }
.agregar-medio svg { width: 26px; height: 26px; }
.agregar-medio input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.estado-pub { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.estado-pub svg { width: 20px; height: 20px; }
.estado-pub.ok { background: var(--ok-f); color: #145C3C; }
.estado-pub.error { background: var(--error-f); color: #7A1E16; }
.estado-pub.proc { background: #E6F0FB; color: var(--azul-hondo); }
.estado-pub.prog { background: var(--alerta-f); color: #6B4100; }

.cal { background: #fff; border: 1px solid var(--gris); border-radius: var(--radio); padding: 12px; margin-bottom: 14px; }
.cal-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-cab b { font-size: 15px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-grid .dn { font-size: 11px; font-weight: 700; color: var(--pizarra); padding: 4px 0; }
.cal-grid button { aspect-ratio: 1; border-radius: 10px; font-size: 13.5px; font-weight: 600; position: relative; display: grid; place-items: center; }
.cal-grid button.fuera { color: #B9C6D2; }
.cal-grid button.hoy { color: var(--azul); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--azul); }
.cal-grid button.sel { background: var(--tinta); color: #fff; box-shadow: none; }
.cal-grid button .puntos { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.cal-grid button .puntos i { width: 5px; height: 5px; border-radius: 50%; background: var(--azul); }
.cal-grid button .puntos i.ok { background: var(--ok); }
.cal-grid button .puntos i.error { background: var(--error); }
.cal-grid button .puntos i.bor { background: #B9C6D2; }
.cal-grid button.sel .puntos i { box-shadow: 0 0 0 1px #fff; }
.dia-titulo { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pizarra); margin: 18px 2px 8px; }

.vista-ig { background: #fff; border: 1px solid var(--gris); border-radius: var(--radio); overflow: hidden; }
.vista-ig .cab-ig { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 700; }
.vista-ig .cab-ig .avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 12px; }
.vista-ig .img { aspect-ratio: var(--ar, 4/5); background: var(--bruma) center/cover no-repeat; }
.vista-ig .txt { padding: 10px 12px 14px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: hidden; }

/* ───── documentos ───── */
.item-doc { background: #fff; border: 1px solid var(--gris); border-radius: 14px; padding: 12px; }
.item-doc + .item-doc { margin-top: 8px; }
.item-doc .cab-i { display: flex; gap: 8px; align-items: flex-start; }
.item-doc .cab-i input { flex: 1; font-weight: 700; }
.item-doc .fila-i { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; margin-top: 8px; }
.item-doc .fila-i input, .item-doc .fila-i select { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.item-doc .fila-i select { padding-right: 28px; background-position: right 6px center; background-size: 16px; }
.item-doc textarea { min-height: 60px; margin-top: 8px; font-size: 14px; }
.item-doc .importe { margin-top: 8px; text-align: right; font-weight: 800; font-size: 15px; }
.totales-ed { background: var(--tinta); color: #fff; border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.totales-ed div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; }
.totales-ed div span:first-child { opacity: .75; }
.totales-ed .total { font-size: 20px; font-weight: 800; border-top: 1px solid rgba(255,255,255,.2); margin-top: 6px; padding-top: 8px; }
.totales-ed .total span:first-child { opacity: 1; }
.seccion-ed { background: #fff; border: 1px solid var(--gris); border-radius: 14px; padding: 12px; }
.seccion-ed + .seccion-ed { margin-top: 10px; }
.seccion-ed .cab-i { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.seccion-ed .cab-i input { flex: 1; font-weight: 700; }
.seccion-ed .btn-ico { width: 36px; height: 36px; }
.seccion-ed .btn-ico svg { width: 18px; height: 18px; }
.cat-check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--gris); border-radius: 14px; background: #fff; font-weight: 700; }
.cat-check + .cat-check { margin-top: 8px; }
.cat-check input { width: 22px; height: 22px; accent-color: var(--azul); }
.cat-check small { display: block; font-weight: 500; color: var(--pizarra); font-size: 12.5px; }

.ficha { display: flex; gap: 14px; align-items: center; }
.ficha .avatar { width: 58px; height: 58px; font-size: 20px; border-radius: 18px; }
.ficha h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.contacto { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.contacto a, .contacto button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 13px; background: var(--bruma); font-size: 11.5px; font-weight: 700; text-decoration: none; color: var(--tinta); }
.contacto svg { width: 20px; height: 20px; color: var(--azul); }
.contacto .wa-c svg { color: var(--wa); }
.contacto .off { opacity: .4; pointer-events: none; }
.datos-lista { display: grid; gap: 0; }
.datos-lista div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--gris); font-size: 14px; }
.datos-lista div:first-child { border-top: 0; }
.datos-lista dt { color: var(--pizarra); font-weight: 600; }
.datos-lista dd { text-align: right; font-weight: 600; word-break: break-word; }
.nota-txt { white-space: pre-wrap; font-size: 14px; }

.resultado-ia { background: #fff; border: 1.5px solid var(--gris); border-radius: 14px; padding: 14px; }
.resultado-ia + .resultado-ia { margin-top: 10px; }
.resultado-ia h4 { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--azul); margin-bottom: 6px; }
.resultado-ia .txt { white-space: pre-wrap; font-size: 14.5px; word-break: break-word; }
.resultado-ia .tags { margin-top: 8px; color: var(--azul); font-size: 13.5px; }
.resultado-ia .botones { margin-top: 12px; }

.guia { counter-reset: paso; list-style: none; }
.guia li { position: relative; padding: 0 0 14px 40px; font-size: 14px; }
.guia li::before { counter-increment: paso; content: counter(paso); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #E6F0FB; color: var(--azul); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.guia code { font-size: 12.5px; background: var(--bruma); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.var-falta { background: var(--alerta-f); color: #6B4100; border-radius: 4px; padding: 0 3px; font-weight: 700; }

@media (min-width: 760px) {
  main.vista { padding-top: 24px; }
  .pub-medios { grid-template-columns: repeat(4, 1fr); }
}
