/* =========================================================
   Control de Acceso — estilos propios (portería, historial).
   La estructura y la marca vienen de /marca/marca.css y /marca/plataforma.css
   (las mismas del Portal GPS). --conjunto = color del conjunto.
   ========================================================= */

/* Logo o color del conjunto en la cabecera */
.acc-ico-conjunto { background: color-mix(in srgb, var(--conjunto) 14%, #fff); color: var(--conjunto); }

/* Ingreso por la dirección del conjunto */
.acc-login-conjunto { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 10px 12px; border: 1px solid var(--ss-line);
  border-left: 4px solid var(--conjunto); border-radius: 12px; background: #F8FAFC; }
.acc-login-conjunto img { max-height: 40px; max-width: 110px; object-fit: contain; }
.acc-login-conjunto > span { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--conjunto) 14%, #fff); color: var(--conjunto); }
.acc-login-conjunto small { display: block; color: var(--ss-muted); font-size: .72rem; }
.acc-login-conjunto strong { color: var(--ss-navy); font-family: 'Space Grotesk', sans-serif; }

/* Lector de cédula */
.panel-lector { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: #EEF4FF; border: 1px solid #CFE0FF; border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.panel-lector label { font-weight: 700; color: var(--ss-navy); font-size: .85rem; margin: 0; }
.panel-lector label i { color: var(--ss-blue); }
.panel-lector input { max-width: 420px; flex: 1 1 260px; }
.lector-estado { font-size: .8rem; color: #047857; font-weight: 600; }
.doc-estado { display: block; min-height: 1.15rem; font-size: .76rem; margin-top: 4px; font-weight: 600; color: #94A3B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-estado.encontrado { color: #047857; }

/* Cámara del visitante */
.camara-caja { width: 100%; aspect-ratio: 1 / 1; max-width: 240px; background: #0A2540; border-radius: 14px; overflow: hidden; display: grid; place-items: center; position: relative; margin: 0 auto; }
.camara-caja video, .camara-caja img { width: 100%; height: 100%; object-fit: cover; }
.camara-caja .camara-vacia { color: #7F95B3; text-align: center; font-size: .8rem; }
.camara-caja .camara-vacia i { display: block; font-size: 2.2rem; margin-bottom: 6px; color: #29B6F6; }
.camara-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }

.foto-mini { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: #E2E8F0; color: #94A3B8; }

/* Historial */
.hist-fila { display: grid; grid-template-columns: 90px 56px minmax(140px, 1fr) 110px minmax(160px, 1.3fr) minmax(150px, 1fr) 100px; gap: 14px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--ss-line); }
.hist-fila:last-child { border-bottom: 0; }
.hist-id { font-size: .78rem; color: #94A3B8; font-weight: 700; }
.hist-id small { display: block; font-weight: 500; line-height: 1.4; margin-top: 2px; }
.hist-foto img, .hist-foto span { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: #EEF1F5; color: #94A3B8; font-size: 1.2rem; }
.hist-nombre { font-weight: 600; text-transform: capitalize; }
.hist-doc { font-size: .8rem; color: var(--ss-muted); }
.hist-unidad { font-weight: 700; color: var(--ss-blue); }
.hist-nota { font-size: .8rem; line-height: 1.6; }
.hist-mov { font-size: .8rem; }
.hist-mov div + div { margin-top: 6px; }
.hist-mov i { width: 16px; }
.hist-mov .ent { color: #059669; }
.hist-mov .sal { color: #BE123C; }
@media (max-width: 991.98px) {
  .hist-fila { grid-template-columns: 56px 1fr auto; }
  .hist-id, .hist-nota { grid-column: 2 / -1; }
  .hist-id { order: 5; }
  .hist-unidad { order: 2; }
  .hist-mov { grid-column: 1 / -1; display: flex; gap: 16px; }
  .hist-mov div + div { margin-top: 0; }
}

/* Estados */
.badge-dentro { background: #DDFBF2; color: #047857; }
.badge-fuera { background: #F1F5F9; color: #64748B; }
.badge-pend { background: #FEF3C7; color: #92400E; }
.badge-dentro, .badge-fuera, .badge-pend { font-weight: 600; }

.color-punto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; border: 1px solid rgba(0,0,0,.1); }
code.url-acceso { font-size: .78rem; background: #F1F5F9; color: var(--ss-navy); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.acciones { white-space: nowrap; text-align: right; }
.acciones form { display: inline; }

/* ===== Correspondencia ===== */
.lector-qr { max-width: 320px; margin: 0 auto; border-radius: 12px; overflow: hidden; }
.lector-qr:empty { display: none; }
.qr-retiro { display: inline-block; padding: 10px; border: 1px solid #E2E8F0; border-radius: 12px; background: #fff; }
.qr-retiro img, .qr-retiro canvas { display: block; }
.codigo-retiro { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 700; letter-spacing: .3em; color: var(--ss-navy, #0A2540); }

/* ===== Áreas comunes ===== */
.areas-tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.area-tab { --c: #0E6BFF; flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; min-width: 170px; padding: 10px 14px;
  border-radius: 14px; background: #fff; border: 1.5px solid #E2E8F0; color: inherit; text-decoration: none; }
.area-tab i { grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.area-tab span { font-weight: 600; }
.area-tab small { color: #64748B; font-size: .75rem; }
.area-tab.activo { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.area-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.cal-semana { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: 58px repeat(7, minmax(92px, 1fr)); gap: 4px; min-width: 720px; }
.cal-esq, .cal-dia, .cal-hora { font-size: .78rem; color: #475569; }
.cal-dia { text-align: center; padding: 6px 2px; border-radius: 8px; background: #F1F5F9; }
.cal-dia.hoy { background: #0A2540; color: #fff; }
.cal-hora { text-align: right; padding: 8px 6px 0 0; font-variant-numeric: tabular-nums; }
.cal-celda { min-height: 44px; border: 0; border-radius: 8px; font-size: .74rem; line-height: 1.2; padding: 4px; color: #0F172A; }
.cal-celda.libre { background: #DCFCE7; color: #166534; cursor: pointer; }
.cal-celda.parcial { background: #ECFCCB; color: #3F6212; cursor: pointer; }
.cal-celda.libre:hover, .cal-celda.parcial:hover { outline: 2px solid #16A34A; }
.cal-celda.ocupado { background: #E2E8F0; color: #475569; }
.cal-celda.mia { background: #0E6BFF; color: #fff; font-weight: 600; }
.cal-celda.pend { background: #FEF3C7; color: #92400E; }
.cal-celda.cerrado, .cal-celda.pasado, .cal-celda.fuera { background: repeating-linear-gradient(45deg, #F8FAFC 0 6px, #F1F5F9 6px 12px); color: #94A3B8; }
.cal-celda:disabled { cursor: default; }
.cal-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #475569; }
.cal-leyenda i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.cal-leyenda .libre { background: #DCFCE7; border: 1px solid #86EFAC; } .cal-leyenda .parcial { background: #ECFCCB; border: 1px solid #BEF264; }
.cal-leyenda .ocupado { background: #E2E8F0; } .cal-leyenda .mia { background: #0E6BFF; } .cal-leyenda .pend { background: #FEF3C7; border: 1px solid #FCD34D; }
.cal-leyenda .cerrado { background: repeating-linear-gradient(45deg, #F8FAFC 0 3px, #E2E8F0 3px 6px); }
.res-resumen { background: #F1F5F9; border-radius: 10px; padding: 10px 12px; }

/* ---------- Adjuntos (fotos y soportes) ---------- */
.adjuntos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.adjunto { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #F1F5F9; border: 1px solid #E2E8F0; display: block; }
.adjunto img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.adjunto:hover img { transform: scale(1.06); }
.adjunto small { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(10,37,64,.72); color: #fff; font-size: .65rem; text-align: center; padding: 1px 2px; text-transform: capitalize; }
.adj-pdf { display: grid; place-items: center; width: 100%; height: 100%; color: #DC2626; font-size: 1.9rem; }

/* ---------- Mascotas ---------- */
.mascota-card { transition: transform .15s, box-shadow .15s; overflow: hidden; }
.mascota-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(10,37,64,.12); }
.mascota-foto { height: 170px; background: linear-gradient(135deg, #E8F0FF, #F1F5F9); display: grid; place-items: center; color: #94A3B8; font-size: 3.4rem; overflow: hidden; }
.mascota-foto img { width: 100%; height: 100%; object-fit: cover; }
.mascota-foto.grande { height: 260px; font-size: 5rem; }
.mascota-ficha { overflow: hidden; }
.mascota-mini { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: #F1F5F9; display: inline-grid; place-items: center; color: #94A3B8; flex: none; }
.mascota-mini img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Mantenimiento ---------- */
.bitacora li { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #EEF2F7; }
.bitacora li > i { width: 30px; height: 30px; border-radius: 50%; background: #E8F0FF; color: #0E6BFF; display: grid; place-items: center; flex: none; font-size: .8rem; }
.bitacora li.interno { background: #FFFBEB; }
.bitacora li.interno > i { background: #FEF3C7; color: #B45309; }
.estrellas { display: inline-flex; flex-direction: row-reverse; gap: 4px; font-size: 1.7rem; }
.estrellas input { display: none; }
.estrellas label { color: #CBD5E1; cursor: pointer; }
.estrellas input:checked ~ label, .estrellas label:hover, .estrellas label:hover ~ label { color: #F59E0B; }
@media print { .adjunto { width: 64px; height: 64px; } .bitacora li { break-inside: avoid; } }

/* ---------- Parqueadero ---------- */
.pq-total { background: linear-gradient(135deg, #0A2540, #0E6BFF); color: #fff; border-radius: 14px; padding: 16px; text-align: center; }
.pq-total.cero { background: #F1F5F9; color: #475569; }
.pq-valor { font-family: 'Space Grotesk', sans-serif; font-size: 2.6rem; font-weight: 700; line-height: 1.1; }
