/* ==========================================================================
   SECPLAM · SEGUIMIENTO E INFORMES (Fase 6) — prefijos .sg- e .inf-
   ========================================================================== */
#alertas-root, #calendario-root, #pendientes-root, #mapa-root { display: flex; flex-direction: column; gap: 16px; }
.sg-sec { padding: 18px 20px !important; }
.sg-sec-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sg-sec-h h3 { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.sg-sec-h h3 svg { width: 17px; height: 17px; color: var(--c, var(--primary-start)); }
.sg-sec-h > span { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }
.sg-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.sg-note { font-size: 0.74rem; color: var(--text-muted); line-height: 1.5; }
.sg-empty { display: flex; align-items: center; gap: 8px; padding: 18px; color: #047857; font-weight: 600; font-size: 0.86rem; background: #f0fdf4; border-radius: 10px; }
.sg-empty svg { width: 18px; height: 18px; }
.nav-count-alert { background: #dc2626 !important; color: #fff !important; }

/* Centro de alertas */
.sg-alert-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sg-acard { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--border-color); border-top: 4px solid var(--c); border-radius: 12px; padding: 12px 14px; font-family: inherit; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s; }
.sg-acard:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07); transform: translateY(-1px); }
.sg-acard.active { box-shadow: inset 0 0 0 2px var(--c); background: color-mix(in srgb, var(--c) 5%, #fff); }
.sg-acard.is-zero { opacity: 0.6; }
.sg-acard:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.sg-acard-ico { grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.sg-acard-ico svg { width: 18px; height: 18px; }
.sg-acard-n { font-size: 1.45rem; font-weight: 800; color: var(--text-main); line-height: 1; }
.sg-acard-t { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); line-height: 1.25; }
.sg-alist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sg-alist button { width: 100%; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border-color); background: #fff; border-radius: 10px; padding: 10px 12px; font-family: inherit; text-align: left; cursor: pointer; }
.sg-alist button:hover { border-color: var(--primary-start); }
.sg-alist div { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.sg-alist strong { font-size: 0.84rem; color: var(--text-main); }
.sg-alist div > span { font-size: 0.8rem; color: var(--text-main); }
.sg-alist small { font-size: 0.74rem; color: var(--text-muted); }
.sg-alist button > svg { width: 16px; height: 16px; color: #94a3b8; align-self: center; }

/* Calendario */
.sg-caltool { padding: 14px 18px !important; display: flex; flex-direction: column; gap: 12px; }
.sg-caltool > .sg-nav, .sg-caltool > .sg-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sg-caltool { display: grid !important; grid-template-columns: 1fr auto; }
.sg-types { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.sg-nav h3 { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-left: 6px; text-transform: capitalize; }
.sg-ibtn { width: 34px; height: 34px; border: 1px solid var(--border-color); background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-main); }
.sg-ibtn svg { width: 16px; height: 16px; }
.sg-tchip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-color); background: #fff; border-radius: 999px; padding: 4px 10px; font-family: inherit; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); cursor: pointer; opacity: 0.55; }
.sg-tchip svg { width: 12px; height: 12px; color: var(--c); }
.sg-tchip.on { opacity: 1; color: var(--text-main); border-color: color-mix(in srgb, var(--c) 40%, #fff); background: color-mix(in srgb, var(--c) 6%, #fff); }
.sg-calbody { padding: 14px !important; }
.sg-month { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.sg-dow, .sg-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sg-dow div { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); text-align: center; padding: 8px 0; background: #f8fafc; border-bottom: 1px solid var(--border-color); }
.sg-cell { min-height: 108px; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sg-cell:nth-child(7n) { border-right: none; }
.sg-cell.is-out { background: #fafbfc; }
.sg-cell.is-out .sg-dnum { color: #cbd5e1; }
.sg-cell.is-today { background: rgba(15, 76, 129, 0.04); }
.sg-cell.is-today .sg-dnum { background: var(--primary-start); color: #fff; }
.sg-dnum { align-self: flex-end; border: none; background: none; font-family: inherit; font-size: 0.74rem; font-weight: 700; color: var(--text-main); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.sg-ev { display: flex; align-items: center; gap: 4px; width: 100%; border: none; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); border-radius: 4px; padding: 2px 5px; font-family: inherit; font-size: 0.68rem; font-weight: 600; color: var(--text-main); cursor: pointer; text-align: left; min-width: 0; }
.sg-ev svg { width: 11px; height: 11px; color: var(--c); flex-shrink: 0; }
.sg-ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-ev em { display: none; }
.sg-ev.is-vencido { background: #fef2f2; border-left-color: #dc2626; }
.sg-ev.is-hecho { opacity: 0.55; text-decoration: line-through; }
.sg-more { border: none; background: none; font-family: inherit; font-size: 0.68rem; font-weight: 700; color: var(--primary-start); cursor: pointer; text-align: left; padding: 0 4px; }
.sg-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sg-wcol { border: 1px solid var(--border-color); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 5px; min-height: 240px; min-width: 0; }
.sg-wcol.is-today { border-color: var(--primary-start); box-shadow: inset 0 0 0 1px var(--primary-start); }
.sg-whead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; margin-bottom: 2px; }
.sg-whead span { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); } .sg-whead strong { font-size: 1.1rem; font-weight: 800; }
.sg-wcol .sg-ev { flex-direction: column; align-items: flex-start; padding: 5px 6px; font-size: 0.72rem; }
.sg-wcol .sg-ev span { white-space: normal; }
.sg-wcol .sg-ev em { display: block; font-style: normal; font-size: 0.66rem; color: var(--text-muted); font-weight: 500; }
.sg-none { color: #cbd5e1; text-align: center; margin-top: 8px; }
.sg-ag-block h4 { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 800; color: var(--text-main); margin: 4px 0 10px; }
.sg-ag-block h4 svg { width: 16px; height: 16px; color: var(--primary-start); }
.sg-ag-block.is-over { background: #fffafa; border: 1px solid #fecaca; border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.sg-ag-block.is-over h4, .sg-ag-block.is-over h4 svg { color: #dc2626; }
.sg-ag-day { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.sg-ag-day > time { font-size: 0.74rem; color: var(--text-muted); display: flex; flex-direction: column; }
.sg-ag-day > time strong { font-size: 0.86rem; color: var(--text-main); text-transform: capitalize; }
.sg-agenda { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sg-agenda li { display: flex; gap: 10px; align-items: flex-start; }
.sg-agenda li > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sg-agenda time { font-size: 0.72rem; font-weight: 700; color: #dc2626; }
.sg-agenda li:not(.is-vencido) time { color: var(--text-muted); }
.sg-agenda strong { font-size: 0.84rem; color: var(--text-main); }
.sg-agenda small { font-size: 0.72rem; color: var(--text-muted); }
.sg-ag-ico { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.sg-ag-ico svg { width: 13px; height: 13px; }
.sg-ag-t { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; color: var(--c); }

/* Mis pendientes */
.sg-pendtool { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px !important; }
.sg-pendtool h3 { font-size: 1.05rem; font-weight: 800; color: var(--text-main); }
.sg-pendtool p { font-size: 0.8rem; color: var(--text-muted); }
.sg-pkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sg-pkpis div.dv-kpi { cursor: default; }
.sg-buckets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.sg-bucket { border-top: 4px solid #94a3b8; }
.sg-bucket.is-over { border-top-color: #dc2626; } .sg-bucket.is-7 { border-top-color: #ea580c; }
.sg-simple { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sg-simple button { width: 100%; text-align: left; border: 1px solid var(--border-color); background: #fff; border-radius: 8px; padding: 8px 10px; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.sg-simple button:hover { border-color: var(--primary-start); }
.sg-simple strong { font-size: 0.82rem; color: var(--text-main); }
.sg-simple span { font-size: 0.72rem; color: var(--text-muted); }

/* Mapa */
.sg-maptool { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 14px 18px !important; }
.sg-f { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.sg-f-sm { min-width: 110px; max-width: 140px; }
.sg-f > span { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.sg-f select, .sg-f input { font-family: inherit; font-size: 0.82rem; padding: 7px 9px; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; color: var(--text-main); }
.sg-mapwrap { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
#sg-map { height: 580px; padding: 0 !important; overflow: hidden; z-index: 1; }
.sg-mapside { padding: 16px !important; display: flex; flex-direction: column; gap: 10px; }
.sg-stat { display: flex; align-items: baseline; gap: 8px; border: 1px solid var(--border-color); background: #fff; border-radius: 10px; padding: 10px 12px; font-family: inherit; text-align: left; }
button.sg-stat { cursor: pointer; } button.sg-stat:disabled { cursor: default; opacity: 0.6; }
.sg-stat strong { font-size: 1.4rem; font-weight: 800; color: var(--text-main); }
.sg-stat span { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.sg-stat.is-warn strong { color: #b45309; } .sg-stat.is-bad strong { color: #dc2626; }
.sg-legend { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-top: 1px solid var(--border-color); }
.sg-legend span { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--text-main); }
.sg-legend i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.sg-count-tip { background: transparent !important; border: none !important; box-shadow: none !important; color: #fff !important; font-weight: 800; font-size: 11px; padding: 0 !important; }
.sg-count-tip::before { display: none; }
.sg-pop { display: flex; flex-direction: column; gap: 10px; font-family: 'Outfit', sans-serif; }
.sg-pop-item { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; }
.sg-pop-item:last-child { border-bottom: none; padding-bottom: 0; }
.sg-pop-item strong { font-size: 12px; color: #0f172a; line-height: 1.3; }
.sg-pop-item span { font-size: 11px; color: #64748b; }
.sg-pop-btn { align-self: flex-start; margin-top: 4px; border: none; background: #0f4c81; color: #fff; font-family: inherit; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; }

/* Informes */
.inf-card { padding: 18px 20px !important; margin-bottom: 20px; }
.inf-head h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; color: var(--text-main); }
.inf-head h3 svg { width: 18px; height: 18px; color: var(--primary-start); }
.inf-head p { font-size: 0.8rem; color: var(--text-muted); margin: 4px 0 14px; }
.inf-types { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.inf-type { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border: 1px solid var(--border-color); background: #fff; border-radius: 10px; padding: 10px; font-family: inherit; font-size: 0.74rem; font-weight: 700; color: var(--text-main); text-align: left; cursor: pointer; line-height: 1.25; min-height: 72px; }
.inf-type svg { width: 17px; height: 17px; color: var(--primary-start); }
.inf-type:hover { border-color: var(--primary-start); }
.inf-type.active { background: var(--primary-start); border-color: var(--primary-start); color: #fff; }
.inf-type.active svg { color: #fff; }
.inf-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 14px 0 12px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.inf-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.inf-hint { margin-right: auto; font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.inf-prev { width: min(1100px, 100%) !important; height: calc(100vh - 40px); }
.inf-prev-body { padding: 0 !important; background: #e2e8f0; }
.inf-prev-body iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }

@media (max-width: 1280px) { .sg-alert-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .inf-types { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sg-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .sg-mapwrap { grid-template-columns: 1fr; } .sg-pkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sg-week { grid-template-columns: 1fr; } .sg-wcol { min-height: 0; } .sg-caltool { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .sg-alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inf-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-buckets, .sg-pkpis { grid-template-columns: 1fr; }
  .sg-cell { min-height: 64px; } .sg-ev span { display: none; } .sg-ev { justify-content: center; padding: 2px; }
  .sg-ag-day { grid-template-columns: 1fr; gap: 4px; }
  #sg-map { height: 420px; }
  .sg-f, .sg-f-sm { min-width: calc(50% - 6px); max-width: none; }
}

/* ---------- Informes: catálogo por grupos y vista inmediata ---------- */
.inf-cat { display: flex; flex-direction: column; gap: 12px; }
.inf-grp h4 { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 6px; }
.inf-grp-b { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.inf-cat .inf-type { flex-direction: row; align-items: flex-start; gap: 10px; min-height: 0; padding: 10px 12px; }
.inf-cat .inf-type svg { flex-shrink: 0; margin-top: 2px; }
.inf-cat .inf-type span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inf-cat .inf-type strong { font-size: 0.8rem; font-weight: 800; }
.inf-cat .inf-type small { font-size: 0.68rem; font-weight: 500; color: var(--text-muted); line-height: 1.3; }
.inf-cat .inf-type.active small { color: rgba(255, 255, 255, 0.85); }
.inf-hint { display: inline-flex; align-items: center; gap: 6px; }
.inf-hint svg { width: 15px; height: 15px; }
.inf-live { margin-top: 14px; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; background: #e9eef4; padding: 14px; }
.inf-live iframe { display: block; width: 100%; max-width: 1180px; margin: 0 auto; min-height: 520px; border: 0; background: #fff; border-radius: 8px; box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12); }
.inf-err { color: #b91c1c; font-weight: 600; padding: 12px; }
@media (max-width: 768px) { .inf-live { padding: 6px; } .inf-grp-b { grid-template-columns: 1fr; } }
