/* ==========================================================================
   Panel para publicar — Centro Educativo Cristiano Claren Lehman
   Modelo del panel de Hopro (menú lateral oscuro, paneles blancos), en verde.
   ========================================================================== */
:root {
  --verde: #14532D;
  --verde-oscuro: #0B3B1F;
  --verde-medio: #2E7D32;
  --rojo: #C62828;
  --rojo-oscuro: #A11F1F;
  --dorado: #E0A526;
  --gris: #5B6475;
  --fondo: #F2F6F2;
  --borde: #DCE5DC;
  --texto: #1A2233;
}

body.admin { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; background: var(--fondo); color: var(--texto); font-size: .95rem; }
a { color: var(--verde-medio); }
a:hover { color: var(--verde); }
:focus-visible { outline: 3px solid var(--dorado); outline-offset: 2px; }
.saltar-contenido { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--verde); color: #fff; padding: .5rem 1rem; border-radius: 6px; }
.saltar-contenido:focus { left: 8px; color: #fff; }

.btn { border-radius: 8px; font-weight: 600; }
.btn-verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-verde:hover, .btn-verde:focus { background: var(--verde-oscuro); border-color: var(--verde-oscuro); color: #fff; }
.btn-acento { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn-acento:hover, .btn-acento:focus { background: var(--rojo-oscuro); border-color: var(--rojo-oscuro); color: #fff; }
.btn-outline-verde { border: 1px solid var(--verde); color: var(--verde); background: #fff; }
.btn-outline-verde:hover, .btn-outline-verde:focus { background: var(--verde); color: #fff; }
.form-control, .form-select { border-radius: 8px; border-color: #ccd3de; }
.form-control:focus, .form-select:focus { border-color: var(--verde-medio); box-shadow: 0 0 0 .2rem rgba(0, 96, 168, .15); }
.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.form-text { font-size: .8rem; }
.form-check-input:checked { background-color: var(--verde); border-color: var(--verde); }

/* ---------- Estructura ---------- */
.admin-contenedor { display: flex; min-height: 100vh; }
.admin-lateral {
  width: 250px; flex-shrink: 0; flex-direction: column;
  background: var(--verde-oscuro); color: rgba(255,255,255,.85);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-marca { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; padding: 1.25rem 1.25rem 1rem; color: #fff; text-decoration: none; font-weight: 600; font-size: .85rem; }
.admin-marca:hover { color: #fff; }
.admin-marca-texto { display: flex; align-items: center; gap: .6rem; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.45rem; font-weight: 700; color: #fff; }
.admin-marca-texto img { width: 44px; height: 44px; background: #fff; border-radius: 50%; padding: 4px; display: block; }
.admin-principal { flex: 1; min-width: 0; padding: 1.25rem; }
@media (min-width: 992px) { .admin-principal { padding: 2rem 2.25rem; } }

.admin-nav { display: flex; flex-direction: column; flex: 1; }
.admin-nav ul { list-style: none; padding: .5rem .75rem; margin: 0; }
.admin-nav li a { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: 8px; color: rgba(255,255,255,.85); text-decoration: none; font-weight: 500; }
.admin-nav li a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav li a.activo { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--dorado); }
.admin-nav li a .bi { font-size: 1.05rem; }
.admin-nav-pie { margin-top: auto; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
.admin-nav-pie a, .admin-nav-pie button { display: block; color: rgba(255,255,255,.8); text-decoration: none; background: none; border: 0; padding: .3rem 0; font: inherit; text-align: left; cursor: pointer; }
.admin-nav-pie a:hover, .admin-nav-pie button:hover { color: #fff; }
.admin-usuario { margin: .75rem 0 0; color: #fff; line-height: 1.3; }
.admin-usuario small { color: #FFB27A; }

.admin-barra { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; background: var(--verde-oscuro); color: #fff; padding: .55rem 1rem; }
.admin-barra img { height: 34px; width: auto; background: #fff; border-radius: 50%; padding: 3px; }
.admin-barra-titulo { font-weight: 600; flex: 1; }
.admin-lateral-movil { background: var(--verde-oscuro); color: #fff; max-width: 280px; }
.admin-lateral-movil .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-lateral-movil .offcanvas-header .admin-marca-texto img { width: 40px; height: 40px; }

/* ---------- Encabezados y paneles ---------- */
.admin-encabezado { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-encabezado h1 { font-size: 1.6rem; font-weight: 700; color: var(--verde); margin: 0 0 .15rem; }
.volver { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; text-decoration: none; margin-bottom: .35rem; }
.panel { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 1.25rem; margin-bottom: 1.5rem; }
.panel h2 { font-size: 1.05rem; font-weight: 700; color: var(--verde); margin: 0 0 .75rem; }
.panel-ayuda { color: var(--gris); font-size: .85rem; margin: -.4rem 0 1rem; }

.tarjeta-dato {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 1rem 1.1rem;
  text-decoration: none; color: var(--texto);
}
.tarjeta-dato:hover { border-color: var(--verde-medio); color: var(--texto); }
.tarjeta-dato-numero { font-size: 1.9rem; font-weight: 700; color: var(--verde); line-height: 1.1; }
.tarjeta-dato-etiqueta { color: var(--gris); font-size: .85rem; }
.tarjeta-dato .bi { position: absolute; right: 1rem; top: 1rem; font-size: 1.4rem; color: rgba(20, 83, 45, .22); }
@media (max-width: 575.98px) {
  .cifras-compactas .tarjeta-dato { padding: .75rem .7rem; }
  .cifras-compactas .tarjeta-dato .bi { display: none; }
  .cifras-compactas .tarjeta-dato-numero { font-size: 1.5rem; }
  .cifras-compactas .tarjeta-dato-etiqueta { font-size: .78rem; line-height: 1.25; }
}

/* Listas tipo tarjeta (usuarios, publicaciones, diapositivas) */
.lista-filas { list-style: none; padding: 0; margin: 0; }
.fila { display: flex; align-items: center; gap: .9rem; padding: .8rem 0; border-bottom: 1px solid var(--borde); }
.fila:last-child { border-bottom: 0; }
.fila-principal { min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.fila-principal:hover { color: inherit; }
.fila-titulo { display: block; font-weight: 600; color: var(--texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-detalle { display: block; font-size: .82rem; color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila.apagada { opacity: .6; }
.avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.miniatura { width: 96px; height: 60px; flex-shrink: 0; object-fit: cover; border-radius: 8px; background: var(--fondo); }
.botones-orden { display: flex; flex-direction: column; }
.botones-orden button { width: 34px; height: 30px; border: 0; background: none; border-radius: 6px; color: var(--gris); }
.botones-orden button:hover:not(:disabled) { background: var(--fondo); color: var(--verde); }
.botones-orden button:disabled { opacity: .25; }
.estado { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: .15rem .55rem; border-radius: 30px; }
.estado-si { background: #E3F5EC; color: #146C43; }
.estado-no { background: #ECEEF2; color: var(--gris); }

/* Opciones grandes (radio con descripción) */
.opcion { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--borde); border-radius: 10px; padding: .8rem .9rem; cursor: pointer; margin-bottom: .5rem; }
.opcion:has(input:checked) { border-color: var(--verde-medio); background: #EEF4FB; }
.opcion strong { display: block; }
.opcion small { color: var(--gris); }

/* Vista previa de la diapositiva */
.vista-diapositiva { position: relative; aspect-ratio: 4 / 5; max-width: 340px; margin: 0 auto; border-radius: 18px; overflow: hidden; background: var(--verde); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem; text-align: center; }
.vista-diapositiva img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vista-diapositiva::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(11,59,31,.085) 0%, rgba(11,59,31,.325) 50%, rgba(11,59,31,.69) 100%); }
/* Vista previa ancha: la proporción del carrusel en una computadora */
.vista-ancha { position: relative; aspect-ratio: 2.8 / 1; border-radius: 12px; overflow: hidden; background: var(--verde); }
.vista-ancha img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vista-diapositiva > * { position: relative; z-index: 2; }
.vista-titulo { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.vista-boton { display: inline-block; margin-top: .9rem; background: var(--rojo); border-radius: 8px; padding: .55rem 1rem; font-weight: 600; }

.barra-guardar { position: sticky; bottom: 0; z-index: 10; background: rgba(242, 244, 248, .96); border-top: 1px solid var(--borde); padding: .85rem 0; margin-top: 1rem; display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Login ---------- */
.admin-login {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem;
  background: radial-gradient(100% 60% at 100% 0%, #2E7D32 0%, transparent 60%), radial-gradient(80% 50% at 0% 100%, rgba(224, 165, 38, .30) 0%, transparent 60%), linear-gradient(135deg, var(--verde) 0%, var(--verde-oscuro) 100%);
}
.login-caja { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 2rem 1.75rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo img { width: 110px; height: 110px; background: #fff; border-radius: 50%; padding: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.login-nombre { display: block; margin-top: .75rem; font-family: "Cormorant Garamond", Georgia, serif; font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.05; }
.login-nombre small { display: block; font-family: Inter, system-ui, sans-serif; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #B9E3B9; }

/* ---------- Ventana de confirmación (public/js/confirmar.js, la misma de Hopro): reemplaza el confirm() del navegador ---------- */
.modal-confirmar { border: 0; border-radius: 14px; box-shadow: 0 18px 50px rgba(20, 83, 45, .25); }
.modal-confirmar h2 { font-family: 'Cormorant Garamond', Georgia, serif; color: var(--verde); font-weight: 700; font-size: 1.6rem; line-height: 1.2; }
.modal-confirmar .confirmar-texto { color: var(--texto); font-size: .97rem; }
.modal-confirmar .btn { min-width: 8rem; font-weight: 600; border-radius: 10px; }
.confirmar-icono { width: 3.6rem; height: 3.6rem; border-radius: 50%; margin: 0 auto .9rem; display: grid; place-items: center; font-size: 1.6rem; background: #E6EEF8; color: var(--verde); }
.confirmar-peligro .confirmar-icono { background: #FBE9EA; color: #B02A37; }
.confirmar-peligro h2 { color: #8A1F2B; }
.confirmar-aviso .confirmar-icono { background: #FDEBE0; color: var(--rojo-oscuro); }
.estado-borrador { background: #FFF1E0; color: #9A4A00; }

/* Celular: títulos en 2 líneas (no cortados), miniatura más chica y botones de guardar a todo lo ancho */
@media (max-width: 575.98px) {
  .fila { gap: .65rem; align-items: flex-start; }
  .fila-titulo { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .fila-detalle { white-space: normal; }
  .miniatura { width: 64px; height: 48px; }
  .barra-guardar { flex-direction: column-reverse; padding: .75rem 0; }
  .barra-guardar .btn { width: 100%; }
}

/* ── Directiva y pastores: fotos redondas como en la web ───────── */
.foto-persona { width: 48px; height: 60px; flex-shrink: 0; border-radius: 8px; object-fit: cover; object-position: center 20%; background: var(--fondo); border: 2px solid var(--rojo); }
.foto-iniciales { display: inline-flex; align-items: center; justify-content: center; background: var(--verde); color: #fff; font-weight: 700; font-size: .95rem; }
.foto-grande { width: 160px; height: 200px; border-radius: 14px; border-width: 4px; font-size: 2.6rem; }
.pastores-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.chip-pastor { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem .2rem .2rem; border: 1px solid var(--borde); border-radius: 30px; background: #fff; color: var(--texto); text-decoration: none; font-size: .85rem; max-width: 100%; }
.chip-pastor:hover { border-color: var(--verde-medio); color: var(--verde); }
.chip-pastor > span:not(.estado):not(.chip-iniciales) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-pastor img, .chip-iniciales { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.chip-iniciales { display: inline-flex; align-items: center; justify-content: center; background: var(--verde); color: #fff; font-size: .68rem; font-weight: 700; }
.fila-iglesia .fila-principal { min-width: 0; }
.nav-pills .nav-link { color: var(--verde); }
.nav-pills .nav-link.active { background: var(--verde); }
.nav-tabs .nav-link { color: var(--gris); }
.nav-tabs .nav-link.active { color: var(--verde); font-weight: 600; }
@media (max-width: 575.98px) {
  .foto-persona { width: 40px; height: 50px; }
  .foto-grande { width: 136px; height: 170px; }
}

/* ── Galería: subir fotos y cuadrícula ───────────────────────── */
.subir-fotos { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: 1.4rem 1rem; border: 2px dashed var(--borde); border-radius: 12px; background: var(--fondo); cursor: pointer; color: var(--texto); }
.subir-fotos:hover, .subir-fotos:focus-within { border-color: var(--verde-medio); }
.subir-fotos i { font-size: 2rem; color: var(--verde-medio); }
.subir-fotos span { font-size: .85rem; color: var(--gris); }
.subir-fotos input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.subir-fotos.ocupada { opacity: .6; pointer-events: none; }
.subida-avance { margin-top: .9rem; }
.subida-avance .progress-bar { background: var(--verde-medio); transition: width .3s ease; }
.panel-fotos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 576px) { .panel-fotos { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .panel-fotos { grid-template-columns: repeat(5, 1fr); } }
.panel-fotos li { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--fondo); }
.panel-fotos img { width: 100%; height: 100%; object-fit: cover; }
.panel-fotos li.es-portada { outline: 3px solid var(--dorado); outline-offset: -3px; }
.etiqueta-portada { position: absolute; left: 4px; top: 4px; font-size: .68rem; font-weight: 700; color: #fff; background: var(--dorado); padding: .1rem .45rem; border-radius: 20px; }
.panel-foto-acciones { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 4px; }
.panel-foto-acciones button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(11, 59, 31, .78); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; }
.panel-foto-acciones button:hover, .panel-foto-acciones button:focus-visible { background: var(--rojo); }
.campo-pagina textarea { field-sizing: content; min-height: 4.5rem; max-height: 60vh; }
.punto-conf { width: .7rem; height: .7rem; border-radius: 50%; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ── «Corregir con IA» ─────────────────────────────────────────── */
.ia-barra { display: flex; justify-content: flex-end; margin: -.2rem 0 .35rem; }
.btn-ia { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #E9D38A; background: #FFF8E1; color: #6B4E00; border-radius: 999px; font-weight: 600; padding: .2rem .75rem; }
.btn-ia i { color: #C9A227; }
.btn-ia:hover, .btn-ia:focus-visible { background: #FCEFC0; color: #4A3600; border-color: #C9A227; }
.ia-etiqueta { font-weight: 700; font-size: .85rem; margin-bottom: .35rem; }
.ia-caja { min-height: 10rem; white-space: pre-wrap; font-size: .95rem; line-height: 1.6; }
.ia-original { background: var(--fondo); border: 1px solid var(--borde); border-radius: .5rem; padding: .6rem .75rem; color: var(--gris); }
.ia-corregido { border-color: #8FD3A8; }
.ia-cargando { color: var(--gris); padding: 1rem 0; }

/* ---------- Videos (reels verticales) ---------- */
.miniatura.miniatura-vertical, .miniatura-vertical { width: 44px; height: 78px; }
.vista-reel { position: relative; max-width: 260px; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #0b1a33; box-shadow: 0 10px 30px rgba(20, 83, 45, .18); }
.vista-reel video, .vista-reel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vista-reel-vacia { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: rgba(255,255,255,.7); text-align: center; padding: 1rem; font-size: .9rem; }
.vista-reel-vacia i { font-size: 2.4rem; }

/* ── Barra inferior en el celular (modelo del aula de Hopro): accesos rápidos + «Más» ── */
.nav-inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: flex; background: #fff;
  border-top: 1px solid #e3e8f0; box-shadow: 0 -4px 18px rgba(11, 59, 31, .10);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.nav-inferior a, .nav-inferior button {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px 4px; border: 0; background: none; color: #5b6475; font-size: .7rem; font-weight: 600;
  line-height: 1.1; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-inferior-icono { display: grid; place-items: center; width: 46px; height: 28px; border-radius: 14px; font-size: 1.1rem; transition: background .15s; }
.nav-inferior .activo { color: #14532D; }
.nav-inferior .activo .nav-inferior-icono { background: #e3f1e3; color: #C62828; }
.nav-inferior a:active .nav-inferior-icono, .nav-inferior button:active .nav-inferior-icono { background: #e3e8f0; }
@media (max-width: 991.98px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media print { .nav-inferior { display: none !important; } }
@media (max-width: 991.98px) {
  .barra-guardar { bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* Vista previa de Facebook (Mi conferencia y Páginas → Inicio) */
.fb-forma-previa { max-width: 500px; min-height: 120px; border: 1px dashed #CBD3E1; border-radius: 12px; background: #F7F9FC; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fb-forma-previa span { color: #6B7385; font-size: .85rem; padding: 1rem; text-align: center; }
.fb-forma-previa iframe { display: block; max-width: 100%; }
.admin-nav a .badge { font-size: .7rem; }

/* Ficha de una solicitud de inscripción */
.ficha { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: .45rem 1rem; margin: 0; }
.ficha dt { font-weight: 500; color: var(--gris); }
.ficha dd { margin: 0; overflow-wrap: anywhere; }
@media print {
  .admin-lateral, .admin-barra, .nav-inferior, .admin-encabezado .btn, .admin-encabezado .volver, form, .btn-link { display: none !important; }
  .admin-principal { padding: 0; }
  .panel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
