/* PRODESI: diseno mobile-first, compartido con el portal */
@font-face { font-family: Nunito; src: url(/vendor/fonts/nunito.woff2) format('woff2'); font-weight: 200 1000; font-display: swap; }
:root { --p: #00A3E2; --s: #6CB85E; --a: #F28E00; --r: #E7392C; --fondo: #F5F7F9; --tinta: #1E2A35; --suave: #6B7A88; --radio: 18px; --sombra: 0 6px 20px rgba(30,42,53,.07); --bs-primary: var(--p); --bs-body-font-family: Nunito, system-ui, sans-serif; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--fondo); color: var(--tinta); font-family: Nunito, system-ui, sans-serif; font-size: 16px; padding-bottom: calc(84px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -.01em; }
a { color: var(--p); }
.btn { border-radius: 14px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn-primary { background: var(--p); border-color: var(--p); box-shadow: 0 6px 14px color-mix(in srgb, var(--p) 35%, transparent); }
.btn-primary:hover, .btn-primary:active, .btn-primary:focus { background: color-mix(in srgb, var(--p) 85%, #000) !important; border-color: transparent !important; }
.btn-sm { min-height: 36px; border-radius: 11px; }
.form-control, .form-select { border-radius: 13px; min-height: 48px; border-color: #DDE3E9; font-size: 16px; }
textarea.form-control { min-height: 96px; }
.form-control:focus, .form-select:focus { border-color: var(--p); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--p) 22%, transparent); }
.form-label { font-weight: 700; font-size: .85rem; color: var(--suave); margin-bottom: .25rem; }
.form-check-input { width: 1.3em; height: 1.3em; }
.form-check-input:checked { background-color: var(--p); border-color: var(--p); }
.alert { border-radius: 14px; border: 0; }
.modal-content { border: 0; border-radius: 22px; }
.table { --bs-table-bg: transparent; }

/* Barra superior */
.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .4rem; padding: calc(.7rem + env(safe-area-inset-top)) 1rem .7rem; background: color-mix(in srgb, var(--fondo) 85%, transparent); backdrop-filter: blur(12px); }
.barra h1 { font-size: 1.3rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-acciones { display: flex; gap: .3rem; }
.barra-btn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 13px; background: #fff; color: var(--tinta); box-shadow: var(--sombra); text-decoration: none; font-size: 1.15rem; border: 0; }
.punto { position: absolute; top: -3px; right: -3px; background: var(--r); color: #fff; border-radius: 10px; font-size: .68rem; font-weight: 800; padding: 1px 6px; }
.pagina { padding: .25rem 1rem 1rem; max-width: 1180px; margin: 0 auto; }

/* Navegacion inferior */
.inferior { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff; box-shadow: 0 -6px 24px rgba(30,42,53,.08); border-radius: 22px 22px 0 0; padding: .4rem .4rem calc(.4rem + env(safe-area-inset-bottom)); }
.inferior a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--suave); text-decoration: none; font-size: .68rem; font-weight: 700; padding: .3rem 0; border-radius: 14px; }
.inferior a i { font-size: 1.3rem; line-height: 1.2; }
.inferior a.activo { color: var(--p); }
.inferior a.central i { background: var(--p); color: #fff; width: 48px; height: 48px; margin-top: -24px; border-radius: 17px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px color-mix(in srgb, var(--p) 45%, transparent); }

/* Lateral de escritorio */
.lateral { position: fixed; inset: 0 auto 0 0; width: 250px; flex-direction: column; background: var(--tinta); color: #fff; padding: 1rem .75rem; overflow-y: auto; z-index: 40; }
.lateral .marca { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 900; font-size: 1.15rem; padding: .4rem .6rem 1rem; }
.lateral .marca img { width: 36px; height: 36px; border-radius: 10px; background: #fff; }
.lateral nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lateral nav a { color: rgba(255,255,255,.72); text-decoration: none; padding: .55rem .7rem; border-radius: 11px; font-weight: 600; font-size: .92rem; display: flex; gap: .6rem; }
.lateral nav a:hover { background: rgba(255,255,255,.08); }
.lateral nav a.activo { background: var(--p); color: #fff; }
@media (min-width: 992px) { body { padding-bottom: 1rem; } .contenido { margin-left: 250px; } }

/* Tarjetas */
.tarjeta { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: 1rem; margin-bottom: .85rem; }
.tarjeta > h2, .tarjeta > h3 { font-size: 1rem; margin-bottom: .7rem; }
.tarjeta-enlace { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.persona-fila { display: flex; align-items: center; gap: .75rem; background: #fff; border-radius: 16px; box-shadow: var(--sombra); padding: .6rem .75rem; margin-bottom: .55rem; color: inherit; text-decoration: none; }
.persona-fila .nombre { font-weight: 800; line-height: 1.15; }
.persona-fila .detalle { font-size: .8rem; color: var(--suave); }
.avatar { width: 48px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; background: linear-gradient(145deg, color-mix(in srgb, var(--p) 25%, #fff), color-mix(in srgb, var(--s) 30%, #fff)); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; color: var(--tinta); }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 800; background: #EDF1F4; color: var(--tinta); white-space: nowrap; }
.chip-grupo { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.2); }
.chip-grupo.chip-clara { color: var(--tinta); text-shadow: none; }
.chip-rojo { background: #FBE6E1; color: #A3351F; }
.chip-verde { background: #E7F3DD; color: #47702A; }
.chip-ambar { background: #FCF0D9; color: #94620A; }
.filtros { display: flex; gap: .45rem; overflow-x: auto; padding: .1rem .1rem .6rem; scrollbar-width: none; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }
.filtros::-webkit-scrollbar { display: none; }
.filtros a { flex: none; padding: .45rem .85rem; border-radius: 99px; background: #fff; box-shadow: var(--sombra); color: var(--tinta); text-decoration: none; font-weight: 700; font-size: .85rem; }
.filtros a.activo { background: var(--p); color: #fff; }
.buscador { position: relative; margin-bottom: .7rem; }
.buscador i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--suave); }
.buscador input { padding-left: 2.5rem; border: 0; box-shadow: var(--sombra); }

/* Inicio */
.saludo { background: linear-gradient(120deg, var(--p), color-mix(in srgb, var(--p) 55%, var(--s))); color: #fff; border-radius: 22px; padding: 1.1rem 1.2rem; margin-bottom: .9rem; box-shadow: 0 10px 26px color-mix(in srgb, var(--p) 30%, transparent); }
.saludo h2 { font-size: 1.35rem; margin: 0; }
.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-bottom: .9rem; }
@media (min-width: 768px) { .cifras { grid-template-columns: repeat(4, 1fr); } }
.cifra { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: .85rem 1rem; text-decoration: none; color: inherit; display: block; }
.cifra b { font-size: 1.7rem; font-weight: 900; line-height: 1.1; display: block; }
.cifra span { font-size: .8rem; color: var(--suave); font-weight: 700; }
.mosaico { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: 1rem; }
@media (min-width: 768px) { .mosaico { grid-template-columns: repeat(6, 1fr); } }
.mosaico a { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: .85rem .3rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-decoration: none; color: var(--tinta); font-size: .76rem; font-weight: 800; text-align: center; min-height: 92px; justify-content: center; }
.mosaico i { font-size: 1.45rem; width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--p) 14%, #fff); color: var(--p); }
.mosaico a:nth-child(3n+2) i { background: color-mix(in srgb, var(--s) 20%, #fff); color: #5C8A3C; }
.mosaico a:nth-child(3n) i { background: color-mix(in srgb, var(--a) 18%, #fff); color: #B57A10; }

/* Ficha */
.ficha-cabecera { display: flex; gap: .9rem; align-items: center; }
.ficha-foto { width: 96px; height: 128px; object-fit: cover; border-radius: 16px; flex: none; }
.ficha-foto.avatar { font-size: 1.8rem; }
.datos { display: grid; grid-template-columns: 1fr; gap: .55rem; margin: 0; }
@media (min-width: 768px) { .datos { grid-template-columns: 1fr 1fr; } }
.datos dt { font-size: .74rem; color: var(--suave); font-weight: 700; }
.datos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pestanas { display: flex; gap: .3rem; overflow-x: auto; margin: 0 -1rem .7rem; padding: 0 1rem; scrollbar-width: none; border: 0; flex-wrap: nowrap; }
.pestanas .nav-link { border: 0; border-radius: 99px; color: var(--suave); font-weight: 800; font-size: .86rem; white-space: nowrap; padding: .4rem .85rem; }
.pestanas .nav-link.active { background: var(--tinta); color: #fff; }

/* Asistencia */
.rejilla-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
@media (min-width: 576px) { .rejilla-fotos { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 992px) { .rejilla-fotos { grid-template-columns: repeat(8, 1fr); } }
.foto-asistencia { position: relative; border: 0; background: #fff; border-radius: 15px; padding: 0 0 .35rem; box-shadow: var(--sombra); overflow: hidden; text-align: center; transition: transform .1s; }
.foto-asistencia:active { transform: scale(.96); }
.foto-asistencia img, .foto-asistencia .avatar { width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; border-radius: 0; font-size: 1.6rem; display: flex; filter: grayscale(.5); opacity: .8; }
.foto-asistencia .n { font-size: .74rem; font-weight: 800; line-height: 1.1; display: block; padding: .3rem .25rem 0; }
.foto-asistencia .c { font-size: .66rem; color: var(--suave); }
.foto-asistencia.marcado { box-shadow: 0 0 0 3px var(--s); }
.foto-asistencia.marcado img, .foto-asistencia.marcado .avatar { filter: none; opacity: 1; }
.foto-asistencia.marcado::after { content: '\2713'; position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--s); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.contador-flotante { position: sticky; top: 68px; z-index: 10; background: var(--tinta); color: #fff; padding: .35rem .9rem; border-radius: 99px; display: inline-block; font-weight: 800; font-size: .85rem; margin-bottom: .6rem; }

/* Recorte */
.recorte-lienzo { height: 58vh; max-height: 480px; background: #1E2A35; }
.recorte-lienzo img { display: block; max-width: 100%; }

/* Carga y acceso */
.carga { position: fixed; inset: 0; z-index: 100; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; transition: opacity .35s; }
.carga.fuera { opacity: 0; }
.carga img { width: min(72vw, 320px); animation: latir 1.2s ease-in-out infinite; }
.carga-barra { width: 150px; height: 6px; border-radius: 6px; background: #EDF1F4; overflow: hidden; }
.carga-barra span { display: block; height: 100%; width: 40%; border-radius: 6px; background: linear-gradient(90deg, var(--p), var(--s), var(--a)); animation: deslizar 1s ease-in-out infinite; }
@keyframes latir { 50% { transform: scale(1.04); } }
@keyframes deslizar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.acceso { position: relative; z-index: 1; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.acuarela { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; background: radial-gradient(38% 46% at 16% 30%, #B4BCF3, transparent 72%), radial-gradient(34% 40% at 10% 78%, #A2D5F5, transparent 72%), radial-gradient(40% 50% at 50% 50%, #FBF3A0, transparent 72%), radial-gradient(36% 44% at 88% 28%, #FAA49C, transparent 72%), radial-gradient(34% 42% at 82% 80%, #FFC8A0, transparent 72%), #FDFBF7; }
body.sin-barra { padding-bottom: 0; }
.acceso-caja { width: 100%; max-width: 420px; text-align: center; padding: 1.8rem 1.5rem; border-radius: 26px; background: rgba(255, 255, 255, .86); box-shadow: 0 18px 50px rgba(62, 58, 110, .18); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
.acceso-caja img.logo { width: 100%; max-width: 300px; margin-bottom: 1.2rem; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .inferior, .barra, .lateral { display: none !important; } .contenido { margin: 0 !important; } }

/* Sugerencias de calle, prefijo de telefono y guia de la foto */
.sugerencias { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border-radius: 13px; box-shadow: 0 10px 28px rgba(30,42,53,.18); overflow: hidden; max-height: 280px; overflow-y: auto; }
.sugerencias button { display: block; width: 100%; padding: .6rem .8rem; border: 0; background: none; text-align: left; font-weight: 700; color: var(--tinta); }
.sugerencias button:hover, .sugerencias button:focus { background: color-mix(in srgb, var(--p) 10%, #fff); outline: none; }
.sugerencias small { display: block; font-weight: 400; color: var(--suave); }
.sin-sugerencias { padding: .6rem .8rem; color: var(--suave); }
.iti { width: 100%; display: block; }
.iti__search-input { min-height: 44px; }
.guia-cara .cropper-view-box::after { content: ''; position: absolute; left: 22%; right: 22%; top: 16%; bottom: 26%; border: 2px dashed rgba(255,255,255,.85); border-radius: 50%; pointer-events: none; }
.guia-cara .cropper-view-box { outline-color: #fff; }
