/* ══════════════════════════════════════════════════════════
   Transparencia Proactiva – Ecatepec de Morelos
   Paleta: guinda #7B1738 | dorado #C9962A | blanco/gris
   ══════════════════════════════════════════════════════════ */

:root {
  --tp-primary:    #7B1738;
  --tp-primary-dk: #5C1029;
  --tp-primary-lt: #9e2049;
  --tp-gold:       #C9962A;
  --tp-gold-lt:    #e8b84b;
  --tp-bg:         #f4f5f7;
  --tp-card:       #ffffff;
  --tp-text:       #2d2d2d;
  --tp-muted:      #6c757d;
  --tp-border:     #dee2e6;
}

/* ── Reset/Base ─────────────────────────────────────────── */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--tp-bg); color: var(--tp-text); }
a { color: var(--tp-primary); text-decoration: none; }
a:hover { color: var(--tp-gold); }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar-tp {
  background: #fff;
  border-bottom: 3px solid var(--tp-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.navbar-tp .navbar-brand img { height: 52px; max-width: 220px; object-fit: contain; }
.navbar-tp .nav-link {
  color: var(--tp-text) !important;
  font-weight: 500;
  font-size: .93rem;
  padding: .5rem 1rem;
  border-radius: 4px;
  transition: background .2s;
}
.navbar-tp .nav-link:hover,
.navbar-tp .nav-link.active {
  background: var(--tp-primary);
  color: #fff !important;
}
.navbar-tp .social-link { color: var(--tp-primary) !important; font-size: 1.2rem; margin-left: .5rem; }
.navbar-tp .social-link:hover { color: var(--tp-gold) !important; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  background: #000;
  /* altura explícita para que el video tenga referencia en todos los dispositivos */
  height: 78vh;
  height: 78svh; /* svh = small viewport height, descuenta barra del browser en móvil */
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* Video background — object-fit:cover lo recorta para llenar sin deformar */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}
/* Solo el ticker necesita z-index */
.hero-ticker { z-index: 2; }

/* Ajustes responsive del hero */
@media (max-width: 768px) {
  .hero { height: 50vh; height: 50svh; min-height: 260px; }
}
@media (max-width: 480px) {
  .hero { height: 32vh; height: 32svh; min-height: 200px; }
}
.hero-escudo { width: 220px; filter: drop-shadow(0 4px 16px rgba(0,0,0,.4)); }
.hero-title {
  color: #fff;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero-title span { color: var(--tp-gold-lt); }
.hero-periodo { color: var(--tp-gold-lt); font-size: 2rem; font-weight: 700; letter-spacing: .12em; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: .4rem 1.4rem;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
  margin-top: .5rem;
}

/* Ticker inferior hero */
.hero-ticker {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  padding: .5rem 0;
  overflow: hidden;
  white-space: nowrap;
}
.hero-ticker-inner {
  display: inline-block;
  animation: ticker 28s linear infinite;
  color: var(--tp-gold-lt);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .06em;
}
@keyframes ticker { 0%{transform:translateX(100vw)} 100%{transform:translateX(-100%)} }

/* ── Visit counter widget ───────────────────────────────── */
.visit-counter {
  position: fixed;
  bottom: 80px; left: 16px;
  background: var(--tp-primary);
  color: #fff;
  border-radius: 50px;
  padding: .35rem .8rem;
  font-size: .78rem;
  font-weight: 700;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  display: flex; align-items: center; gap: .4rem;
}
.visit-counter i { font-size: .85rem; }

/* ── Satisfacción FAB ───────────────────────────────────── */
.fab-satisfaccion {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--tp-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: .55rem 1.1rem;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 999;
  cursor: pointer;
  transition: background .2s, transform .2s;
  display: flex; align-items: center; gap: .4rem;
}
.fab-satisfaccion:hover { background: var(--tp-primary-dk); transform: translateY(-2px); }

/* ── Sección ────────────────────────────────────────────── */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--tp-primary);
  border-left: 4px solid var(--tp-gold);
  padding-left: .75rem;
  margin-bottom: 1.25rem;
}

/* ── Cards ──────────────────────────────────────────────── */
.tp-card {
  background: var(--tp-card);
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  border: 1px solid var(--tp-border);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.tp-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.tp-card .card-img-top { height: 175px; object-fit: cover; object-position: center top; }
.tp-card .card-body { padding: 1rem 1.1rem; }
.tp-card .card-title { font-size: 1rem; font-weight: 700; color: var(--tp-primary); margin-bottom: .35rem; }
.tp-card .card-text { font-size: .85rem; color: var(--tp-muted); }

/* Progress dentro de card */
.tp-card .prog-label { font-size: .75rem; color: var(--tp-muted); }
.tp-card .prog-pct   { font-size: 1.05rem; font-weight: 700; color: var(--tp-primary); }

/* ── Programa detail ────────────────────────────────────── */
.prog-sidebar {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--tp-border);
  overflow: hidden;
}
.prog-sidebar-header {
  background: var(--tp-primary);
  color: #fff;
  padding: .75rem 1rem;
  font-weight: 700;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: space-between;
}
.prog-sidebar-search {
  padding: .6rem;
  border-bottom: 1px solid var(--tp-border);
}
.prog-sidebar-search input {
  width: 100%;
  border: 1px solid var(--tp-border);
  border-radius: 6px;
  padding: .35rem .65rem;
  font-size: .84rem;
  outline: none;
}
.prog-sidebar-search input:focus { border-color: var(--tp-primary); }
.prog-list { list-style: none; margin: 0; padding: 0; }
.prog-list li a {
  display: block;
  padding: .65rem 1rem;
  font-size: .88rem;
  color: var(--tp-text);
  border-bottom: 1px solid var(--tp-border);
  transition: background .15s;
}
.prog-list li a:hover  { background: #f8f0f3; color: var(--tp-primary); }
.prog-list li a.active { background: var(--tp-primary); color: #fff; font-weight: 600; }
.prog-list li a small  { display: block; font-size: .75rem; opacity: .7; }

/* Detalle principal */
.prog-detail { background: #fff; border-radius: 10px; border: 1px solid var(--tp-border); }
.prog-detail-header {
  background: var(--tp-primary);
  color: #fff;
  padding: 1rem 1.4rem;
  border-radius: 10px 10px 0 0;
}
.prog-detail-header h1 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.prog-detail-header p  { margin: .25rem 0 0; font-size: .85rem; opacity: .85; }

/* Year tabs */
.year-tabs .nav-link {
  color: var(--tp-primary);
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  font-size: .88rem;
}
.year-tabs .nav-link.active {
  background: var(--tp-primary);
  color: #fff;
  border-color: var(--tp-primary);
}

/* Galería */
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: .5rem; }
.galeria-grid img {
  width: 100%; height: 130px; object-fit: cover;
  border-radius: 6px; cursor: pointer;
  transition: transform .2s;
}
.galeria-grid img:hover { transform: scale(1.04); }

/* Doc buttons */
.doc-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--tp-primary); color: #fff;
  border: none; border-radius: 6px;
  padding: .4rem .9rem; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
  text-decoration: none;
}
.doc-btn:hover { background: var(--tp-primary-dk); color: #fff; }
.doc-btn.gold  { background: var(--tp-gold); color: #fff; }
.doc-btn.gold:hover  { background: #a87820; color: #fff; }
.doc-btn.green { background: #198754; }
.doc-btn.green:hover { background: #146c43; }
.doc-btn.blue  { background: #0d6efd; }
.doc-btn.blue:hover  { background: #0a58ca; }
.doc-btn.red   { background: #dc3545; }
.doc-btn.red:hover   { background: #b02a37; }

/* Padrón mes badges */
.padron-btn {
  display: inline-block;
  padding: .3rem .75rem;
  border-radius: 50px;
  font-size: .78rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .2s;
}
.padron-btn.inactive { background: #e9ecef; color: #495057; }
.padron-btn.active   { background: var(--tp-primary); color: #fff; }
.padron-btn:hover    { opacity: .85; }

/* Ítem de mes con sus descargas debajo */
.padron-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}
.padron-downloads {
  display: flex; gap: .3rem;
  min-height: 26px;
}
.mini-dl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  color: #fff !important;
  font-size: .95rem;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
}
.mini-dl:hover { transform: translateY(-2px); box-shadow: 0 3px 6px rgba(0,0,0,.18); color: #fff; }
.mini-dl.pdf  { background: #dc3545; }
.mini-dl.csv  { background: #198754; }
.mini-dl.xlsx { background: #0d6efd; }

/* ── Dashboard de indicadores ───────────────────────────── */
.ind-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--tp-border);
  padding: 1rem 1.25rem;
}
.ind-card .ind-num {
  font-size: 2rem; font-weight: 800; color: var(--tp-primary);
  line-height: 1;
}
.ind-card .ind-label { font-size: .8rem; color: var(--tp-muted); margin-top: .15rem; }

.chart-container { position: relative; }

/* ── Admin ──────────────────────────────────────────────── */
.admin-bar {
  background: var(--tp-primary);
  color: #fff;
  padding: .4rem 1rem;
  font-size: .82rem;
  display: flex; align-items: center; gap: .5rem;
}
.admin-bar a { color: rgba(255,255,255,.8); font-size: .8rem; }
.admin-bar a:hover { color: #fff; }
.admin-bar .breadcrumb { margin: 0; background: transparent; padding: 0; }
.admin-bar .breadcrumb-item { font-size: .8rem; color: rgba(255,255,255,.8); }
.admin-bar .breadcrumb-item.active { color: #fff; }
.admin-bar .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.5); }

.admin-welcome {
  background: linear-gradient(135deg, var(--tp-primary-dk), var(--tp-primary));
  color: #fff;
  border-radius: 10px;
  padding: 1rem 1.4rem;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-welcome h5 { margin: 0; font-size: 1rem; }
.admin-welcome .btn-group .btn { font-size: .8rem; }

.admin-section {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--tp-border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.admin-section-header {
  background: #f8f9fa;
  border-bottom: 1px solid var(--tp-border);
  padding: .75rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-section-header h6 {
  margin: 0;
  font-weight: 700;
  font-size: .92rem;
  color: var(--tp-primary);
  display: flex; align-items: center; gap: .5rem;
}
.admin-section-body { padding: 1rem 1.1rem; }

/* Tabla admin */
.tp-table { width: 100%; font-size: .85rem; }
.tp-table thead th {
  background: var(--tp-primary);
  color: #fff;
  font-weight: 600;
  padding: .6rem .8rem;
  border: none;
}
.tp-table tbody td { padding: .6rem .8rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.tp-table tbody tr:last-child td { border-bottom: none; }
.tp-table tbody tr:hover { background: #fdf5f7; }

/* Botones de acción pequeños */
.btn-tp { background: var(--tp-primary); color: #fff; border: none; }
.btn-tp:hover { background: var(--tp-primary-dk); color: #fff; }
.btn-tp-outline { border: 1.5px solid var(--tp-primary); color: var(--tp-primary); background: transparent; }
.btn-tp-outline:hover { background: var(--tp-primary); color: #fff; }

/* Encuesta stats */
.enc-stat {
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
}
.enc-stat .num  { font-size: 2rem; font-weight: 800; }
.enc-stat .label{ font-size: .78rem; color: var(--tp-muted); }

/* ── Modal ──────────────────────────────────────────────── */
.modal-header-tp {
  background: var(--tp-primary);
  color: #fff;
  border-radius: .5rem .5rem 0 0;
}
.modal-header-tp .btn-close { filter: invert(1); }

.modal-section {
  background: #f8f9fa;
  border-left: 3px solid var(--tp-primary);
  padding: .5rem .75rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: .75rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--tp-primary);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: flex; align-items: center; gap: .4rem;
}

/* Upload thumbnails en galería */
.galeria-upload-preview {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem;
}
.galeria-upload-preview .thumb {
  position: relative; width: 80px; height: 70px;
}
.galeria-upload-preview img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
  border: 2px solid var(--tp-border);
}
.galeria-upload-preview .thumb .del-btn {
  position: absolute; top: -6px; right: -6px;
  background: #dc3545; color: #fff; border: none; border-radius: 50%;
  width: 18px; height: 18px; font-size: 10px; line-height: 18px;
  text-align: center; cursor: pointer; padding: 0;
}

/* Archivo existente en form admin */
.file-existente {
  display: flex; align-items: center; flex-wrap: wrap; gap: .3rem;
  background: #f0fdf4; border: 1px solid #86efac;
  border-radius: 6px; padding: .3rem .6rem;
  font-size: .78rem; color: #166534;
}
.file-existente a { color: #166534; font-weight: 600; word-break: break-all; }
.file-existente a:hover { text-decoration: underline; }
.btn-clear-file {
  background: none; border: 1px solid #16a34a; color: #16a34a;
  border-radius: 4px; padding: .1rem .4rem; font-size: .72rem;
  cursor: pointer; white-space: nowrap;
}
.btn-clear-file:hover { background: #16a34a; color: #fff; }

/* Año badge en documentación */
.anio-badge {
  display: inline-block; padding: .15rem .6rem;
  background: var(--tp-primary); color: #fff;
  border-radius: 50px; font-size: .75rem; font-weight: 700;
  margin-left: .4rem;
}

/* Tabs selector de año de captura (admin) */
.anio-tab {
  display: inline-flex; align-items: center;
  padding: .35rem .85rem;
  border-radius: 20px;
  border: 1.5px solid #adb5bd;
  background: #fff;
  color: #495057;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
}
.anio-tab:hover { background: #f1f3f5; border-color: var(--tp-primary); }
.anio-tab.active {
  background: var(--tp-primary);
  border-color: var(--tp-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(123,23,56,.25);
}

/* Padrón guardado badge */
.padron-saved {
  display: inline-flex; align-items: center; gap: .25rem;
  background: #e9ecef; color: #495057;
  border-radius: 50px; padding: .15rem .6rem;
  font-size: .75rem; font-weight: 600; margin: .15rem;
}
.padron-saved .del-p { cursor: pointer; color: #dc3545; font-weight: 700; }

/* Progress bar guinda */
.progress-tp .progress-bar { background: var(--tp-primary); }

/* ── Lightbox sencillo ──────────────────────────────────── */
#lightbox-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9999;
  align-items: center; justify-content: center;
}
#lightbox-overlay.show { display: flex; }
#lightbox-overlay img { max-width: 90vw; max-height: 88vh; border-radius: 6px; }
#lightbox-overlay .close-lb {
  position: absolute; top: 16px; right: 20px;
  color: #fff; font-size: 2rem; cursor: pointer; line-height: 1;
}

/* ── Footer ─────────────────────────────────────────────── */
footer.tp-footer {
  background: var(--tp-primary-dk);
  color: rgba(255,255,255,.85);
  padding: 2.5rem 0 0;
  margin-top: 3rem;
}
footer.tp-footer h6 {
  color: var(--tp-gold-lt);
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .9rem;
}
footer.tp-footer p { font-size: .83rem; line-height: 1.6; }
footer.tp-footer a { color: rgba(255,255,255,.75); font-size: .85rem; display: block; margin-bottom: .3rem; }
footer.tp-footer a:hover { color: var(--tp-gold-lt); }
footer.tp-footer .contact-item { display: flex; gap: .6rem; font-size: .82rem; margin-bottom: .4rem; align-items: flex-start; }
footer.tp-footer .contact-item i { color: var(--tp-gold-lt); margin-top: 2px; }
footer.tp-footer .footer-bottom {
  background: rgba(0,0,0,.3);
  padding: .8rem;
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  margin-top: 2rem;
}
footer.tp-footer .social-footer a { display: inline-block; margin-right: .5rem; font-size: 1.3rem; color: rgba(255,255,255,.75); }
footer.tp-footer .social-footer a:hover { color: var(--tp-gold-lt); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero-title  { font-size: 1.8rem; }
  .hero-periodo{ font-size: 1.4rem; }
  .hero-escudo { width: 160px; }
}
