/* =====================================================================
   SGTP Riobamba — hoja de estilos de la aplicación
   Se carga después del sistema de diseño Broadsheet (_ds/.../styles.css)
   y usa sus variables (--font-*, --space-*, --color-neutral-*).
   El HTML no lleva estilos en línea. Los colores del semáforo son configurables
   por el administrador: la lógica los publica como variables --tl-<clave> en
   <html> y los elementos los toman con el atributo data-tl="<clave>".
   ===================================================================== */

/* ---------- Identidad: línea gráfica de campaña «El Johnvi» ----------
   Manual de marca (marcas.ai / «marcas copia.pdf»):
   · Tipografía principal Amsi Pro (texto, controles y títulos). Se sirve desde assets/fonts/ y,
     si el equipo ya la tiene instalada, se usa la copia local.
   · Tipografía secundaria Rocket Raccoon Free (rótulos de marca y títulos de pantalla). No se
     distribuye con la app: se toma de la instalación local si existe y, si no, cae en Amsi Pro Black.
     Para servirla, copie el archivo a assets/fonts/ y agregue su url() en la regla @font-face.
   · Paleta: siete colores principales y siete secundarios (variables --jv-*). El azul #147BE2 es el
     acento de la interfaz y el celeste #33B5E5 el secundario; el rojo queda para avisos y el semáforo.
   · Azul marino #132F5B (pieza «Plan Riobamba») solo para títulos y texto sobre blanco: la paleta
     no tiene un azul oscuro con contraste suficiente para leer. */
@font-face { font-family: "Amsi Pro"; font-weight: 400; font-style: normal; font-display: swap;
  src: local("Amsi Pro Regular"), local("AmsiPro-Regular"), url("../fonts/AmsiPro-Regular.otf") format("opentype"); }
@font-face { font-family: "Amsi Pro"; font-weight: 600; font-style: normal; font-display: swap;
  src: local("Amsi Pro SemiBold"), local("AmsiPro-SemiBold"), url("../fonts/AmsiPro-SemiBold.otf") format("opentype"); }
@font-face { font-family: "Amsi Pro"; font-weight: 700; font-style: normal; font-display: swap;
  src: local("Amsi Pro Bold"), local("AmsiPro-Bold"), url("../fonts/AmsiPro-Bold.otf") format("opentype"); }
@font-face { font-family: "Amsi Pro"; font-weight: 900; font-style: normal; font-display: swap;
  src: local("Amsi Pro Black"), local("AmsiPro-Black"), url("../fonts/AmsiPro-Black.otf") format("opentype"); }
@font-face { font-family: "Rocket Raccoon"; font-weight: 400 900; font-style: normal; font-display: swap;
  src: local("Rocket Raccoon Free"), local("RocketRaccoonFree"), local("Rocket Raccoon"), local("RocketRaccoon");
  /* , url("../fonts/RocketRaccoonFree.otf") format("opentype") */ }
:root {
  /* Fuentes: sobrescriben las del sistema de diseño Broadsheet */
  --font-body: "Amsi Pro", "Segoe UI", system-ui, sans-serif;
  --font-heading: "Amsi Pro", "Segoe UI", system-ui, sans-serif;
  --font-heading-weight: 700;
  --font-display: "Rocket Raccoon", "Amsi Pro", "Segoe UI", system-ui, sans-serif;
  /* Paleta principal */
  --jv-azul: #147BE2; --jv-rosa: #D81A60; --jv-verde: #009145; --jv-morado: #B22DB2;
  --jv-celeste: #00BCD5; --jv-amarillo: #FFEB3C; --jv-naranja: #FF7244;
  /* Paleta secundaria */
  --jv-celeste-2: #33B5E5; --jv-rojo: #FF0049; --jv-verde-2: #30D61E; --jv-fucsia: #F706B3;
  --jv-petroleo: #0E91AF; --jv-amarillo-2: #F7C906; --jv-naranja-2: #E0490E;
  /* Acentos de la interfaz */
  --color-accent: var(--jv-azul); --color-accent-500: var(--jv-azul); --color-accent-600: #1166c0; --color-accent-700: #0f4f97;
  --color-accent-100: #e8f2fd; --color-accent-200: #c6def9; --color-accent-300: #93c1f3;
  --color-accent-2: var(--jv-celeste-2); --color-accent-2-100: #e6f6fc; --color-accent-2-200: #c2e9f7; --color-accent-2-700: #1a7ea6;
  --sg-navy: #132F5B;
  --sg-danger: var(--jv-rosa);
  --sg-ink: #201e1d;
  --sg-map-bg: #faf9f8;
  --sg-side-w: 236px;
  /* Semáforo (valores por defecto tomados de la paleta; Configuración los sobrescribe) */
  --tl-gris: #9b9797; --tl-rojo: var(--jv-rojo); --tl-amarillo: var(--jv-amarillo-2); --tl-verde: var(--jv-verde); --tl-azul: var(--jv-azul);
}
[data-tl="gris"]     { --c: var(--tl-gris);     --fg: var(--sg-ink); }
[data-tl="rojo"]     { --c: var(--tl-rojo);     --fg: #fff; }
[data-tl="amarillo"] { --c: var(--tl-amarillo); --fg: var(--sg-ink); }
[data-tl="verde"]    { --c: var(--tl-verde);    --fg: #fff; }
[data-tl="azul"]     { --c: var(--tl-azul);     --fg: #fff; }
body { margin: 0; background: var(--color-bg); }
/* Banner de error dentro de <main>: en pantallas pequeñas el pie de la barra lateral (donde vive el otro) está oculto */
.sg-alert--main { display: none; margin: 0 0 12px; }
@media (max-width: 900px) { .sg-alert--main { display: block; } }
/* Estado vacío de las tablas */
.sg-empty { margin: 14px 0 0; padding: 14px 16px; border: 1px dashed var(--color-neutral-400, #bab6b6); border-radius: 8px; color: var(--color-neutral-700); }
.sg-side-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--color-neutral-700); text-decoration: underline; }
/* «Volver al menú»: enlace con aspecto de botón en el pie de la barra lateral */
.sg-side-menu-link { display: block; box-sizing: border-box; margin: 0 0 8px; text-align: center; text-decoration: none; color: var(--sg-navy); font-weight: 600; }
.sg-side-menu-link:hover { color: var(--color-accent-700); }
a { color: var(--color-accent-700); text-decoration: none; }
a:hover { color: var(--color-accent-2-700, #1a7ea6); }   /* el celeste claro (#33B5E5) como texto no llega a 4,5:1 */
button { font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); font-size: 14px; }

/* ---------- Controles ---------- */
.sg-in { width: 100%; padding: 7px 9px; border: 1px solid var(--color-neutral-400); border-radius: 2px; background: #fff; color: var(--color-text); box-sizing: border-box; }
.sg-in:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.sg-in--search { width: 240px; }
/* Buscador del mapa: una lupa que se despliega al pasar el mouse, al enfocar o mientras hay texto.
   Las sugerencias cuelgan debajo; cada una lleva el tipo (plataforma, parroquia, barrio, equipamiento). */
.sg-search { position: relative; display: flex; align-items: center; height: 36px; width: 36px; border: 1px solid var(--color-neutral-400); border-radius: 999px; background: #fff; overflow: visible; transition: width .2s ease, border-color .2s; box-sizing: border-box; }
.sg-search:hover, .sg-search:focus-within, .sg-search[data-has="1"] { width: 300px; border-color: var(--color-accent-300); }
.sg-search-ico { flex: none; width: 34px; height: 34px; background: var(--color-accent-700) center / 18px no-repeat; border-radius: 999px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.5-4.5'/%3E%3C/svg%3E") center / 18px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.5-4.5'/%3E%3C/svg%3E") center / 18px no-repeat; }
.sg-search .sg-in--search { flex: 1 1 auto; width: 0; min-width: 0; opacity: 0; border: 0; background: none; padding: 6px 10px 6px 0; transition: opacity .15s; }
.sg-search .sg-in--search:focus-visible { outline: none; }
.sg-search:hover .sg-in--search, .sg-search:focus-within .sg-in--search, .sg-search[data-has="1"] .sg-in--search { opacity: 1; }
.sg-search:focus-within { box-shadow: 0 0 0 2px var(--color-accent-200); }
.sg-search-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 340px; max-width: 80vw; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--color-neutral-300); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.sg-search-hit { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none; text-align: left; font: inherit; font-size: 13px; color: var(--color-text); cursor: pointer; }
.sg-search-hit:hover, .sg-search-hit:focus-visible { background: var(--color-accent-100); outline: none; }
.sg-search-kind { grid-row: 1 / 3; align-self: center; padding: 2px 7px; border-radius: 999px; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; color: #fff; background: var(--jv-azul); white-space: nowrap; }
.sg-search-kind[data-kind="parroquia"] { background: var(--jv-naranja-2); }
.sg-search-kind[data-kind="barrio"] { background: var(--jv-verde); }
.sg-search-kind[data-kind="equipamiento"] { background: var(--jv-morado); }
.sg-search-name { font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-search-sub { font-size: 11px; color: var(--color-neutral-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-search-sub:empty { display: none; }
.sg-in--search-sm { width: 220px; }
.sg-b { border: 1px solid var(--color-accent-500); background: var(--color-accent-500); color: #fff; padding: 7px 14px; border-radius: 2px; cursor: pointer; font-size: 14px; }
.sg-b:hover { background: var(--color-accent-600); }
.sg-b:active { background: var(--color-accent-700); }
.sg-b:disabled { opacity: .55; cursor: progress; }
.sg-b2 { border: 1px solid var(--color-neutral-400); background: #fff; color: var(--color-text); padding: 7px 14px; border-radius: 2px; cursor: pointer; font-size: 14px; }
.sg-b2:hover { background: var(--color-accent-100); border-color: var(--color-accent-300); }
.sg-b:focus-visible, .sg-b2:focus-visible, .sg-nav:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.sg-b--block { width: 100%; }
.sg-b--stack { margin-bottom: 6px; }
.sg-b--list { width: 100%; text-align: left; margin-bottom: 5px; }

/* ---------- Tipografía ---------- */
.sg-kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-neutral-600); }
.sg-eyebrow { margin: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-700); }
.sg-h1 { margin: 0; font-size: 30px; font-family: var(--font-display); font-weight: 900; line-height: 1.15; color: var(--sg-navy); }
/* Icono del título de pantalla: una ficha con degradado de marca y el mismo trazo que el menú (data-nav).
   Solo aparece en las pantallas que tienen icono; en las demás el span queda vacío y oculto. */
.sg-h1-ico { display: none; width: 40px; height: 40px; margin-right: 12px; border-radius: 11px; vertical-align: -9px;
  background: linear-gradient(135deg, var(--jv-azul), var(--jv-celeste-2)); box-shadow: 0 3px 8px rgba(20,123,226,.28); }
.sg-h1-ico::before { content: ""; display: block; width: 24px; height: 24px; margin: 8px; background: #fff;
  -webkit-mask: var(--ico) center / 24px 24px no-repeat; mask: var(--ico) center / 24px 24px no-repeat; }
.sg-h1-ico[data-nav="mapa"], .sg-h1-ico[data-nav="tablero"], .sg-h1-ico[data-nav="plataformas"], .sg-h1-ico[data-nav="barrios"],
.sg-h1-ico[data-nav="comunidades"], .sg-h1-ico[data-nav="poblados"], .sg-h1-ico[data-nav="poblaciones"], .sg-h1-ico[data-nav="recintos"], .sg-h1-ico[data-nav="equipamientos"],
.sg-h1-ico[data-nav="obras"], .sg-h1-ico[data-nav="parques"], .sg-h1-ico[data-nav="actividades"], .sg-h1-ico[data-nav="matriz"], .sg-h1-ico[data-nav="cronograma"],
.sg-h1-ico[data-nav="analisis"], .sg-h1-ico[data-nav="reportes"], .sg-h1-ico[data-nav="tipos"], .sg-h1-ico[data-nav="personas"],
.sg-h1-ico[data-nav="calidad"], .sg-h1-ico[data-nav="admin"], .sg-h1-ico[data-nav="config"],
.sg-h1-ico[data-nav="campana"], .sg-h1-ico[data-nav="equipo"], .sg-h1-ico[data-nav="responsabilidades"], .sg-h1-ico[data-nav="capas"] { display: inline-block; }
.sg-h1-ico[data-nav="mapa"] { background: linear-gradient(135deg, var(--jv-azul) 0%, var(--jv-celeste) 60%, var(--jv-verde-2) 100%); }
.sg-h2 { margin: 0 0 10px; font-size: 19px; font-family: var(--font-heading); color: var(--sg-navy); }
.sg-h2--spaced { margin-top: var(--space-6); }
.sg-h2--md { margin: 0 0 8px; font-size: 18px; }
.sg-h2--lg { margin: 2px 0 8px; font-size: 21px; }
.sg-h2--xl { margin: 0 0 4px; font-size: 24px; }
.sg-h2--sm { margin: 0 0 8px; font-size: 20px; }
.sg-sub { margin: 4px 0 0; font-size: 14px; color: var(--color-neutral-700); }
.sg-text { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.sg-text--flush { margin: 0; }
.sg-help { margin: 0; font-size: 14px; color: var(--color-neutral-700); line-height: 1.5; }
.sg-muted { color: var(--color-neutral-700); }
.sg-lock { color: var(--color-neutral-600); font-size: 12px; }
.sg-alert { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--sg-danger); }
.sg-alert--lg { font-size: 14px; }
.sg-loading { font-size: 15px; color: var(--color-neutral-700); }
.sg-kv { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.sg-kv--lg { font-size: 14px; line-height: 1.5; }
.sg-kv-key { color: var(--color-neutral-700); }
.sg-count { margin: 0 0 6px; font-size: 13px; color: var(--color-neutral-700); }

/* ---------- Estructura ---------- */
.sg-app { display: flex; align-items: stretch; min-height: 100vh; font-family: var(--font-body); color: var(--color-text); }
.sg-side { flex: 0 0 var(--sg-side-w); border-right: 1px solid var(--color-neutral-300); padding: var(--space-4) 0; display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: 0; align-self: flex-start; height: 100vh; box-sizing: border-box; }
.sg-side-head { padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sg-menu-btn { display: none; }
.sg-filters-btn { display: none; }
.sg-brand { margin: 2px 0 0; font-size: 17px; font-family: var(--font-display); font-weight: 900; line-height: 1.2; color: var(--sg-navy); }
.sg-side-brand { min-width: 0; }
/* Logotipo «El Johnvi» (assets/johnvi_h.svg y johnvi_v.svg, extraídos de marcas.ai) */
.sg-logo { display: block; width: 150px; height: auto; margin: 0 0 8px; }
.sg-logo--splash { width: 220px; max-width: 70vw; margin-bottom: 14px; }
.sg-logo--modal { width: 96px; margin: 0 auto 10px; }
.sg-side-scroll { overflow-y: auto; flex: 1; }
.sg-side-section { margin: var(--space-4) 0 4px; padding: 0 14px; }
.sg-side-foot { padding: var(--space-3) 14px 0; border-top: 1px solid var(--color-neutral-300); }
.sg-user-name { margin: 0; font-size: 13px; font-weight: 600; }
.sg-user-role { margin: 0 0 8px; font-size: 12px; color: var(--color-neutral-700); }
.sg-side-note { margin: 0 0 8px; font-size: 12px; color: var(--color-neutral-700); line-height: 1.4; }
.sg-nav { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 14px; font-size: 15px; color: var(--color-neutral-800); cursor: pointer; border-left: 3px solid transparent; }
.sg-nav:hover { background: var(--color-accent-100); color: var(--color-accent-700); }
.sg-nav[data-on="1"] { background: var(--color-accent-100); border-left-color: var(--color-accent-2); color: var(--color-accent-700); font-weight: 600; }
.sg-nav-label { min-width: 0; }
/* Icono de cada opción del menú: un trazo en el color del texto (máscara SVG), elegido por data-nav */
.sg-nav-ico { flex: none; width: 20px; height: 20px; background: currentColor; opacity: .8;
  -webkit-mask: var(--ico) center / 20px 20px no-repeat; mask: var(--ico) center / 20px 20px no-repeat; }
.sg-nav[data-on="1"] .sg-nav-ico { opacity: 1; }
[data-nav="mapa"]          { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 6v16l7-4 8 4 7-4V2l-7 4-8-4z'/%3E%3Cpath d='M8 2v16M16 6v16'/%3E%3C/svg%3E"); }
[data-nav="tablero"]       { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16M7 17v-7M12 17V5M17 17v-4'/%3E%3C/svg%3E"); }
[data-nav="plataformas"]   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l10 5-10 5L2 7z'/%3E%3Cpath d='M2 12l10 5 10-5M2 17l10 5 10-5'/%3E%3C/svg%3E"); }
[data-nav="barrios"]       { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8v10h-6v-7H9v7H3z'/%3E%3C/svg%3E"); }
[data-nav="poblaciones"]   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 21v-7l5-4 5 4v7'/%3E%3Cpath d='M12 21v-9l5-4 5 4v9'/%3E%3Cpath d='M9 21v-3h6v3'/%3E%3C/svg%3E"); }
[data-nav="comunidades"]   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2 20c0-3.5 3-6 7-6s7 2.5 7 6'/%3E%3Ccircle cx='17' cy='9' r='2.5'/%3E%3Cpath d='M17 14c3 0 5 2 5 5'/%3E%3C/svg%3E"); }
[data-nav="poblados"]      { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-7 7-12a7 7 0 0 0-14 0c0 5 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E"); }
[data-nav="recintos"]      { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='10' width='18' height='11' rx='2'/%3E%3Cpath d='M8 10V4h8v6M3 15h18'/%3E%3C/svg%3E"); }
[data-nav="equipamientos"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='1'/%3E%3Cpath d='M9 7h2M13 7h2M9 11h2M13 11h2M9 15h2M13 15h2M10 21v-3h4v3'/%3E%3C/svg%3E"); }
[data-nav="obras"]         { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3h4l5 17H5z'/%3E%3Cpath d='M3 20h18M8 10h8M7 15h10'/%3E%3C/svg%3E"); }
[data-nav="actividades"]   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='17' rx='2'/%3E%3Cpath d='M3 9h18M8 2v4M16 2v4'/%3E%3C/svg%3E"); }
[data-nav="parques"]       { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 6 12h3l-4 6h14l-4-6h3z'/%3E%3Cpath d='M12 18v3'/%3E%3C/svg%3E"); }
[data-nav="matriz"]        { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Ccircle cx='6' cy='6' r='2.2'/%3E%3Ccircle cx='12' cy='6' r='2.2'/%3E%3Ccircle cx='18' cy='6' r='2.2'/%3E%3Ccircle cx='6' cy='12' r='2.2'/%3E%3Ccircle cx='12' cy='12' r='2.2'/%3E%3Ccircle cx='18' cy='12' r='2.2'/%3E%3Ccircle cx='6' cy='18' r='2.2'/%3E%3Ccircle cx='12' cy='18' r='2.2'/%3E%3Ccircle cx='18' cy='18' r='2.2'/%3E%3C/svg%3E"); }
[data-nav="cronograma"]    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
[data-nav="analisis"]      { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12A9 9 0 1 1 12 3v9z'/%3E%3Cpath d='M12 3a9 9 0 0 1 9 9h-9z'/%3E%3C/svg%3E"); }
[data-nav="reportes"]      { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h8'/%3E%3C/svg%3E"); }
[data-nav="tipos"]         { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12l-8 8-9-9V3h8z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.5'/%3E%3C/svg%3E"); }
[data-nav="personas"]      { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-7 8-7s8 3 8 7'/%3E%3C/svg%3E"); }
[data-nav="calidad"]       { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E"); }
[data-nav="admin"]         { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h2M10 12h10M4 18h8M16 18h4'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='8' cy='12' r='2'/%3E%3Ccircle cx='14' cy='18' r='2'/%3E%3C/svg%3E"); }
/* Tablero de campaña (megáfono), Equipo y responsables (grupo), ruta vieja de Responsables (organigrama) y Capas geográficas (capas) */
[data-nav="campana"]        { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5v3a1 1 0 0 0 1 1h2.5L12 19V5L6.5 9.5H4a1 1 0 0 0-1 1z'/%3E%3Cpath d='M16 9a4.2 4.2 0 0 1 0 6'/%3E%3Cpath d='M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E"); }
[data-nav="equipo"]         { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6'/%3E%3Ccircle cx='17.5' cy='9' r='2.5'/%3E%3Cpath d='M16.5 14.1c2.9.3 5 2.3 5 5.4'/%3E%3C/svg%3E"); }
[data-nav="responsabilidades"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='5' rx='1'/%3E%3Crect x='3' y='16' width='6' height='5' rx='1'/%3E%3Crect x='15' y='16' width='6' height='5' rx='1'/%3E%3Cpath d='M12 8v4M6 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E"); }
[data-nav="capas"]          { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 4.5-9 4.5-9-4.5z'/%3E%3Cpath d='m3 12 9 4.5 9-4.5'/%3E%3Cpath d='m3 16.5 9 4.5 9-4.5'/%3E%3C/svg%3E"); }
[data-nav="config"]        { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }
/* Botón para plegar o desplegar la barra (solo en computador) */
.sg-side-toggle { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--color-neutral-300); border-radius: 8px; background: #fff; color: var(--color-neutral-700); cursor: pointer; }
.sg-side-toggle:hover { background: var(--color-accent-100); color: var(--color-accent-700); border-color: var(--color-accent-300); }
.sg-side-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.sg-side-toggle-ico { width: 16px; height: 16px; background: currentColor; transition: transform .2s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.sg-side[data-collapsed="1"] .sg-side-toggle-ico { transform: rotate(180deg); }
.sg-logo--mini { display: none; width: 36px; margin: 0 auto 4px; }
/* Barra plegada: una franja de 64 px con el icono de la marca, los iconos del menú y los botones de sesión como iconos */
@media (min-width: 901px) {
  .sg-side[data-collapsed="1"] { --sg-side-w: 64px; }
  .sg-side[data-collapsed="1"] .sg-logo:not(.sg-logo--mini), .sg-side[data-collapsed="1"] .sg-kicker, .sg-side[data-collapsed="1"] .sg-brand,
  .sg-side[data-collapsed="1"] .sg-nav-label, .sg-side[data-collapsed="1"] .sg-side-note, .sg-side[data-collapsed="1"] .sg-user-name,
  .sg-side[data-collapsed="1"] .sg-user-role, .sg-side[data-collapsed="1"] .sg-side-link, .sg-side[data-collapsed="1"] .sg-alert { display: none; }
  .sg-side[data-collapsed="1"] .sg-logo--mini { display: block; }
  .sg-side[data-collapsed="1"] .sg-side-head { flex-direction: column; padding: 0 8px; gap: 6px; }
  .sg-side[data-collapsed="1"] .sg-side-brand { width: 100%; }
  .sg-side[data-collapsed="1"] .sg-nav { justify-content: center; padding: 11px 0; gap: 0; }
  .sg-side[data-collapsed="1"] .sg-nav-ico { width: 22px; height: 22px; -webkit-mask-size: 22px 22px; mask-size: 22px 22px; }
  .sg-side[data-collapsed="1"] .sg-side-section { font-size: 0; margin: 8px 10px 4px; padding: 0; border-top: 1px solid var(--color-neutral-300); }
  .sg-side[data-collapsed="1"] .sg-side-foot { padding: 10px 8px 0; }
  .sg-side[data-collapsed="1"] .sg-foot-btn { font-size: 0; width: 40px; height: 40px; padding: 0; margin: 0 auto 6px; border-radius: 8px; display: grid; place-items: center; }
  .sg-side[data-collapsed="1"] .sg-foot-btn::before { content: ""; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
  .sg-foot-btn--menu { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E"); }
  .sg-foot-btn--in  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5M15 12H3M21 3v18'/%3E%3C/svg%3E"); }
  .sg-foot-btn--out { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 17l5-5-5-5M21 12H9M3 3v18'/%3E%3C/svg%3E"); }
  .sg-foot-btn--pw  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M11 12l9-9M17 6l3 3M14 9l3 3'/%3E%3C/svg%3E"); }
}
.sg-main { flex: 1; min-width: 0; padding: var(--space-6) var(--space-6) 80px; }
.sg-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.sg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sg-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sg-btn-row--tight { margin-top: 10px; }
.sg-btn-row--flush { margin-top: 0; }
.sg-divider-top { margin-top: var(--space-4); border-top: 1px solid var(--color-neutral-300); padding-top: var(--space-3); }
.sg-scroll-x { overflow-x: auto; max-width: 100%; }
.sg-clickable { cursor: pointer; }

/* ---------- Barra de filtros ---------- */
.sg-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: var(--space-3); }
.sg-field { font-size: 12px; }
.sg-field--muted { color: var(--color-neutral-700); }
.sg-field--block { display: block; margin-top: 10px; }
.sg-toggle { font-size: 13px; display: flex; gap: 5px; align-items: center; padding-bottom: 6px; }

/* ---------- Mapa ---------- */
.sg-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-4); align-items: start; }
.sg-map-frame { border: 1px solid var(--color-neutral-300); background: #fff; position: relative; }
.sg-map { display: block; height: 68vh; min-height: 420px; background: var(--sg-map-bg); touch-action: none; cursor: grab; }
/* Mapa base oscuro: fondo oscuro y rótulos del mapa en blanco con halo oscuro */
.sg-map[data-basemap="oscuro"] { background: #1c2129; }
.sg-map[data-basemap="oscuro"] text { fill: #fff; stroke: #141922; }
.sg-map[data-picking="1"] { cursor: crosshair; }
.sg-map path:hover, .sg-map circle:hover { opacity: .8; cursor: pointer; }
.sg-zoom { position: absolute; right: 10px; top: 28px; display: flex; flex-direction: column; gap: 4px; }
.sg-zoom .sg-b2 { width: 36px; height: 36px; padding: 0; font-size: 20px; line-height: 1; background: rgba(255,255,255,.95); }
.sg-zoom .sg-b2.sg-zoom-route { width: auto; height: auto; min-height: 36px; padding: 4px 8px; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.sg-zoom .sg-b2[aria-pressed="true"] { background: var(--sg-navy); color: #fff; }
/* Botón «Centrar en Riobamba»: vuelve al encuadre inicial del cantón */
.sg-zoom .sg-zoom-center { display: grid; place-items: center; color: var(--color-accent-700); }
.sg-zoom-center-ico { width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Ccircle cx='12' cy='12' r='2' fill='%23000'/%3E%3Cpath d='M12 2v4M12 18v4M2 12h4M18 12h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Ccircle cx='12' cy='12' r='2' fill='%23000'/%3E%3Cpath d='M12 2v4M12 18v4M2 12h4M18 12h4'/%3E%3C/svg%3E") center / contain no-repeat; }
.sg-legend { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.92); padding: 8px 10px; font-size: 12px; line-height: 1.5; }
.sg-legend-row { display: flex; gap: 6px; align-items: center; }
.sg-legend-row--scale { margin-top: 6px; }
.sg-legend-inline { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-4); font-size: 13px; }
.sg-dot { display: inline-block; width: 12px; height: 12px; flex: none; background: var(--c, #9b9797); border: 1px solid var(--sg-ink); box-sizing: border-box; }
.sg-scalebar { display: inline-block; flex: none; }
.sg-scalebar rect { fill: var(--sg-ink); }
.sg-cursor { position: absolute; right: 10px; bottom: 10px; margin: 0; font-size: 11px; color: var(--color-neutral-700); background: rgba(255,255,255,.9); padding: 3px 6px; }
.sg-attrib { position: absolute; right: 0; top: 0; margin: 0; padding: 2px 6px; font-size: 10px; color: var(--color-neutral-700); background: rgba(255,255,255,.75); pointer-events: none; }
.sg-basemap image { image-rendering: auto; }
.sg-minimap-frame { position: relative; margin: 0 0 var(--space-6); border: 1px solid var(--color-neutral-300); background: #fff; }
.sg-minimap { display: block; height: 360px; background: var(--sg-map-bg); }
.sg-circ-map { height: 560px; max-height: 70vh; }   /* mapa de circunscripciones del CNE: más alto que el minimapa */
.sg-minimap-hit { cursor: pointer; }
.sg-minimap-hit:hover { opacity: .75; }
.sg-minimap-caption { margin: 0; padding: 6px 10px; font-size: 12px; color: var(--color-neutral-700); border-top: 1px solid var(--color-neutral-300); }
/* El panel toma la altura del mapa (contain: size evita que estire la fila) y desplaza su
   contenido por dentro, así la lista de capas no deja espacio en blanco junto al mapa */
.sg-panel { border: 1px solid var(--color-neutral-300); background: #fff; padding: var(--space-3); min-height: 320px;
  align-self: stretch; contain: size; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sg-stat { margin: 0 0 7px; font-size: 13px; }
.sg-stat-num { font-size: 17px; font-family: var(--font-heading); }

/* ---------- Tablero ---------- */
.sg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.sg-kpi-num { margin: 0; font-size: 34px; font-family: var(--font-heading); line-height: 1; }
.sg-kpi-label { margin: 4px 0 0; font-size: 13px; color: var(--color-neutral-700); line-height: 1.35; }
.sg-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-6); }
.sg-barrow { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 13px; }
.sg-barrow-label { width: 118px; flex: none; }
.sg-barrow-value { width: 96px; flex: none; text-align: right; color: var(--color-neutral-700); }
.sg-barrow-count { width: 40px; flex: none; text-align: right; }
.sg-bartrack { flex: 1; min-width: 0; height: 12px; background: var(--color-neutral-200); display: block; }
.sg-bar { fill: var(--c, var(--color-accent-500)); }
/* Análisis de recintos electorales: urbano (azul) y rural (naranja), barras y mapa */
.sg-bar[data-u="urbano"], .sg-rec-dot[data-u="urbano"] { fill: #147BE2; background: #147BE2; }
.sg-bar[data-u="rural"], .sg-rec-dot[data-u="rural"] { fill: #E38B2A; background: #E38B2A; }
.sg-rec-dot { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 10px; vertical-align: -1px; }
.sg-rec-row .sg-barrow-label { width: 290px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-rec-row .sg-barrow-count { width: 64px; }
.sg-rec-vd { font-weight: 600; }
.sg-rec-map { height: 460px; }
.sg-in--num { width: 120px; }
.sg-num { text-align: right; }
.sg-num--pct { width: 54px; }

/* ---------- Tablas, fichas y matriz ---------- */
.sg-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.sg-t th { text-align: left; font-weight: 600; padding: 7px 10px; border-bottom: 1.5px solid var(--color-text); white-space: nowrap; }
.sg-t td { padding: 7px 10px; border-bottom: 1px solid var(--color-neutral-300); vertical-align: top; }
.sg-t tbody tr:hover { background: var(--color-accent-100); }
.sg-t .sg-th-sm { font-size: 12px; font-weight: 500; }
.sg-td-strong { font-weight: 600; }
.sg-td-center { text-align: center; }
.sg-chip { display: inline-block; min-width: 24px; padding: 1px 5px; font-size: 13px; background: var(--c, #9b9797); color: var(--fg, #fff); }
.sg-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }
.sg-block { min-width: 0; overflow: hidden; }
.sg-block[data-wide="1"] { grid-column: 1 / -1; }

/* ---------- Agenda · cartelera ----------
   Las actividades como en el afiche municipal: un bloque por mes con su regla de colores y una
   tarjeta por jornada. La franja izquierda lleva la fecha en el color de la plataforma (data-pf),
   y «Más información» despliega el texto sin salir de la pantalla (data-abierta). */
.sg-car-mes { margin-bottom: var(--space-6); }
.sg-car-mes-tit { display: flex; align-items: center; gap: var(--space-4); margin: 0 0 var(--space-4);
  font-family: var(--font-heading); font-size: 26px; color: var(--sg-navy); }
.sg-car-arcoiris { flex: 1; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--jv-azul), var(--jv-celeste), var(--jv-verde), var(--jv-amarillo-2), var(--jv-naranja), var(--jv-rosa), var(--jv-morado)); }
.sg-car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--space-4); align-items: start; }

.sg-car { display: grid; grid-template-columns: 74px minmax(0, 1fr); background: #fff;
  border: 1px solid var(--color-neutral-300); overflow: hidden; }
.sg-car-fecha { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 16px 6px; background: var(--c, var(--color-accent-500)); color: var(--fg, #fff); text-align: center; }
.sg-car-dow { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; }
.sg-car-dia { font-family: var(--font-heading); font-size: 30px; line-height: 1; }
.sg-car-mon { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; }
.sg-car-cuerpo { padding: 12px 14px 14px; min-width: 0; }
.sg-car-pf { margin: 0 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  color: var(--c, var(--color-accent-500)); overflow-wrap: anywhere; }
.sg-car-tit { display: block; margin: 0 0 8px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--font-heading); font-size: 17px; line-height: 1.25; text-align: left;
  color: var(--sg-navy); overflow-wrap: anywhere; }
.sg-car-tit:hover, .sg-car-tit:focus-visible { text-decoration: underline; }
.sg-car-dato { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 4px; font-size: 13.5px; line-height: 1.35; }
.sg-car-dato[data-on="0"] { display: none; }
.sg-car-dato::before { content: ""; flex: none; width: 15px; height: 15px; margin-top: 1px;
  background: var(--c, var(--color-accent-500)); -webkit-mask: var(--cico) center / contain no-repeat; mask: var(--cico) center / contain no-repeat; }
[data-cico="etiqueta"] { --cico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 12 22l-9-9V3h10l7.6 7.6a2 2 0 0 1 0 2.8z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.5' fill='%23000'/%3E%3C/svg%3E"); }
[data-cico="lugar"] { --cico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-7 7-12a7 7 0 0 0-14 0c0 5 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E"); }
[data-cico="hora"] { --cico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }

.sg-car-mas { margin-top: 6px; padding: 4px 10px; border: 1px solid transparent; border-radius: 999px;
  background: none; font: inherit; font-size: 13.5px; color: var(--color-accent-600); cursor: pointer; }
.sg-car-mas::after { content: " ⌄"; }
.sg-car-mas[data-on="0"] { display: none; }
.sg-car-mas:hover, .sg-car-mas:focus-visible { border-color: var(--color-accent-300); background: var(--color-accent-100); }
.sg-car[data-abierta="1"] .sg-car-mas::after { content: " ⌃"; }
.sg-car-texto { display: none; margin: 8px 0 0; font-size: 13.5px; line-height: 1.45; white-space: pre-line; }
.sg-car[data-abierta="1"] .sg-car-texto { display: block; }
/* El estado va en su propio renglón, debajo de «Más información» */
.sg-car-estado { display: block; width: fit-content; margin-top: 8px; padding: 1px 8px; font-size: 11.5px;
  background: var(--c, var(--color-neutral-200)); color: var(--fg, #fff); }
.sg-car-mas { display: inline-block; }
.sg-car-estado:empty { display: none; }
/* El estado pinta con su propio color del semáforo, no con el de la plataforma */
.sg-car-estado[data-tl] { background: var(--c); }

@media print {
  .sg-car-grid { grid-template-columns: repeat(2, 1fr); }
  .sg-car { break-inside: avoid; }
  .sg-car-texto { display: block; }     /* en papel se imprime todo, sin desplegar nada */
  .sg-car-mas { display: none; }
}

/* Nombre de usuario: se entra con «apellido + inicial», no con el correo (db/029) */
.sg-adm-user { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .01em; color: var(--color-accent-700); }

/* ---------- Fichas de cifras y tarjetas de las pantallas de detalle ----------
   Un bloque de detalle puede mostrarse de tres formas, combinables: filas «clave: valor»,
   fichas con la cifra grande y tarjetas. Las tarjetas se colorean con data-pf (color de la
   plataforma) o con data-color (paleta de campaña), y la barra usa el mismo svg de las
   demás barras para no llevar estilos en línea. */
.sg-fichas { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.sg-ficha { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  background: var(--color-neutral-100); border-left: 5px solid var(--c, var(--color-accent-500)); }
.sg-ficha-v { font-family: var(--font-heading); font-size: 27px; line-height: 1.05; color: var(--sg-navy); }
.sg-ficha-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-neutral-700); }
.sg-ficha-x { font-size: 12.5px; line-height: 1.35; color: var(--sg-ink); }
.sg-ficha-x:empty { display: none; }

/* Pestañas de una pantalla de lista (Barrios y comunidades). Cada una lleva su color de campaña:
   apagada se dibuja con el color en el borde y el texto; encendida, en el fondo. */
.sg-pestanas { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.sg-pestana { padding: 8px 16px; border-radius: 999px; font: inherit; font-family: var(--font-heading); font-size: 14px;
  cursor: pointer; background: #fff; color: var(--c, var(--color-accent-500));
  border: 2px solid var(--c, var(--color-accent-500)); }
.sg-pestana:hover { background: var(--color-neutral-100); }
.sg-pestana[data-on="1"] { background: var(--c, var(--color-accent-500)); color: var(--fg, #fff); }
.sg-pestana[data-on="1"]:hover { filter: brightness(1.06); }
/* Las fichas de cifras encabezan la lista: un poco más de aire antes del buscador */
.sg-fichas--lista { margin: 0 0 var(--space-4); }
/* Nota al pie del título de un bloque de detalle (p. ej. de dónde sale la lista de vocales) */
.sg-block-nota { margin: -2px 0 10px; }
.sg-block-nota:empty { display: none; }

/* Tarjetas de tipo de actividad y de dirección: la persona a cargo manda, y lo pendiente se nota */
.sg-tarjeta-cargo { display: block; font-size: 12.5px; line-height: 1.35; color: var(--sg-ink); }
.sg-tarjeta-cargo b { font-weight: 700; }
.sg-tarjeta-cargo[data-pend="1"], .sg-tarjeta-sub2[data-pend="1"] { color: var(--color-neutral-600); font-style: italic; }
.sg-tarjeta-aviso { display: block; font-size: 11.5px; color: var(--jv-rojo); }
.sg-tarjeta-aviso:empty { display: none; }
.sg-tarjeta--tipo[data-off="1"] { opacity: .62; }
.sg-tarjeta--dir[data-on="1"] { box-shadow: inset 0 0 0 2px var(--c, var(--color-accent-500)); }
.sg-tarjeta-cifra[data-on="0"] { display: none; }
.sg-tarjetas[data-tam="sm"] .sg-tarjeta--dir { min-height: 0; }
/* Encabezado de cada grupo de unidades (direcciones, jefaturas, empresas) */
.sg-adm-grupo { margin: var(--space-5) 0 var(--space-2); }
.sg-adm-grupo:first-of-type { margin-top: var(--space-3); }

/* ---------- Responsables (matriz de la campaña) ----------
   Cada área técnica, producto o sector es una tarjeta con forma de árbol: arriba, con su sello, quien la
   encabeza (veedor o responsable); debajo, cada actividad cuelga de una rama con fichas de responsable (azul
   noche) y apoyo (celeste). El color del bloque (azul, verde o naranja) solo tiñe el filete superior y el sello,
   así la página se lee en los colores de la campaña sin un arcoíris de grupos. En «Por persona», cada persona
   con todo lo que tiene a su cargo. */
.sg-rs-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: var(--space-2); }
.sg-rs-barra .sg-pestanas { margin-bottom: 0; }
.sg-rs-herr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sg-rs-vista { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--color-neutral-100, #f1efed); }
.sg-rs-vista-b { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-family: var(--font-heading); font-size: 13.5px; color: var(--sg-navy); }
.sg-rs-vista-b[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(19, 47, 91, .18); }
.sg-rs-vista-b:focus-visible { outline: 2px solid var(--jv-azul); outline-offset: 1px; }
.sg-rs-buscar { width: 240px; max-width: 100%; }
.sg-rs-intro { margin: 6px 0 4px; }
.sg-rs-resumen { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-4); }
.sg-rs-dato { padding: 4px 11px; border-radius: 999px; background: #e8f2fc; color: var(--sg-navy); font-size: 13px; }
.sg-rs-dato b { font-family: var(--font-heading); font-size: 14px; }
.sg-rs-dato[data-estado="ok"] { background: #e3f5ea; color: #0b6b35; }
.sg-rs-dato[data-estado="falta"] { background: #fde7ea; color: #b3261e; font-weight: 600; }
.sg-rs-dato:empty { display: none; }

.sg-rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-4); align-items: start; }
.sg-rs-card, .sg-rs-pers { background: #fff; border: 1px solid var(--color-neutral-300); border-top: 4px solid var(--c, var(--jv-azul));
  border-radius: 10px; padding: 14px 16px 12px; break-inside: avoid; }
.sg-rs-pers { --c: var(--sg-navy); }
.sg-rs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sg-rs-tit { margin: 0; font-family: var(--font-heading); font-size: 18px; line-height: 1.2; color: var(--sg-navy); overflow-wrap: anywhere; }
.sg-rs-n { flex: none; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--color-neutral-700); }
/* Raíz del árbol: quien encabeza el grupo */
.sg-rs-raiz { display: flex; align-items: center; gap: 10px; }
.sg-rs-av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font-family: var(--font-heading); font-size: 14px; background: var(--c, var(--jv-azul)); color: var(--fg, #fff); }
.sg-rs-av[data-pend="1"] { background: #fff; color: #b3261e; box-shadow: inset 0 0 0 2px #f2b8bf; }
.sg-rs-quien-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sg-rs-k { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--jv-azul); }
.sg-rs-nom { font-family: var(--font-heading); font-size: 15.5px; color: var(--sg-navy); overflow-wrap: anywhere; }
.sg-rs-nom[data-pend="1"] { font-family: var(--font-body); font-style: italic; color: #b3261e; }
.sg-rs-c { font-size: 12px; color: var(--color-neutral-700); overflow-wrap: anywhere; }
.sg-rs-c:empty, .sg-rs-unidad:empty, .sg-rs-donde:empty, .sg-rs-chip-k:empty { display: none; }
.sg-rs-unidad { margin: 8px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--color-neutral-700); }
/* Ramas: una línea vertical baja desde el sello y cada actividad sale de ella con un codo redondeado */
.sg-rs-arbol { list-style: none; margin: 10px 0 0; padding: 0 0 0 19px; }
.sg-rs-arbol[data-raiz="false"] { padding-left: 4px; }
.sg-rs-rama { position: relative; padding: 6px 0 8px 22px; display: flex; flex-direction: column; gap: 4px; }
.sg-rs-rama::before { content: ''; position: absolute; left: 0; top: 0; width: 14px; height: 17px;
  border-left: 2px solid #c6d9ee; border-bottom: 2px solid #c6d9ee; border-bottom-left-radius: 8px; }
.sg-rs-rama::after { content: ''; position: absolute; left: 0; top: 17px; bottom: 0; border-left: 2px solid #c6d9ee; }
.sg-rs-rama:last-child::after { display: none; }
.sg-rs-act { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--sg-ink); }
.sg-rs-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sg-rs-chips:empty { display: none; }
.sg-rs-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; line-height: 1.3; }
.sg-rs-chip-k { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.sg-rs-chip[data-rol="resp"] { background: var(--sg-navy); color: #fff; }
.sg-rs-chip[data-rol="resp"][data-pend="1"] { background: #fde7ea; color: #b3261e; font-style: italic; }
.sg-rs-chip[data-rol="apoyo"] { background: #e3f4fb; color: #0e5876; box-shadow: inset 0 0 0 1px #b4e2f3; }
.sg-rs-chip[data-rol="lider"] { background: var(--jv-azul); color: #fff; }
/* Por persona: lista de encargos con su papel */
.sg-rs-enc { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--color-neutral-200, #ebe9e7); }
.sg-rs-enc li { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: 2px 8px; padding: 7px 0; border-bottom: 1px solid var(--color-neutral-200, #ebe9e7); }
.sg-rs-enc li:last-child { border-bottom: 0; }
.sg-rs-que { font-size: 13.5px; font-weight: 600; color: var(--sg-ink); }
.sg-rs-donde { grid-column: 2; font-size: 12px; color: var(--color-neutral-700); }
.sg-rs-sueltos { margin-top: var(--space-5); padding: 8px 12px; font-size: 13px; background: var(--color-neutral-100, #f1efed); border-radius: 8px; }
.sg-rs-sueltos summary { cursor: pointer; color: var(--sg-navy); }
.sg-rs-sueltos p { margin: 6px 0 2px; line-height: 1.45; }
.sg-rs-sueltos .sg-b { margin-top: 6px; }
/* Responsables ↔ Personas: aviso con el botón «Registrar y conectar» y estado de cada nombre del formulario */
.sg-mz-enlace { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 var(--space-3); padding: 9px 12px;
  font-size: 13px; line-height: 1.4; background: #fff6e0; border-left: 4px solid var(--jv-amarillo-2); border-radius: 6px; }
.sg-mz-enlace p { margin: 0; flex: 1 1 260px; }
.sg-mz-enlace[data-ok="1"] { background: #e3f5ea; border-left-color: var(--jv-verde); color: #0b6b35; }
.sg-mz-quien { margin: -4px 0 8px; }
.sg-mz-quien:empty { display: none; }
@media (max-width: 600px) {
  .sg-rs-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .sg-rs-herr, .sg-rs-buscar { width: 100%; }
  .sg-rs-card, .sg-rs-pers { padding: 12px 12px 10px; }
  .sg-rs-tit { font-size: 16px; }
}
@media print {
  .sg-rs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-rs-card, .sg-rs-pers, .sg-rs-av, .sg-rs-chip, .sg-rs-dato { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.sg-mz-fuente { margin-top: var(--space-5); }
.sg-mz-fuente:empty { display: none; }
/* En administración el grupo es un título con su botón de añadir */
.sg-mz-grupo-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-left: 10px; border-left: 4px solid var(--c, var(--color-accent-500)); }
.sg-mz-add { padding: 4px 10px; font-size: 12.5px; }

.sg-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.sg-tarjetas[data-tam="sm"] { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.sg-tarjeta { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 10px 12px 11px;
  font: inherit; color: inherit; text-align: left; background: #fff;
  border: 1px solid var(--color-neutral-300); border-top: 4px solid var(--c, var(--color-accent-500)); cursor: default; }
.sg-tarjeta[data-link="1"] { cursor: pointer; }
.sg-tarjeta[data-link="1"]:hover, .sg-tarjeta:focus-visible { background: var(--color-neutral-100); border-color: var(--c, var(--color-accent-500)); }
.sg-tarjeta-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sg-tarjeta-sello { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--c, var(--color-accent-500)); color: var(--fg, #fff); font-family: var(--font-heading); font-size: 16px; }
.sg-tarjetas[data-tam="sm"] .sg-tarjeta-sello { width: 28px; height: 28px; font-size: 12.5px; }
.sg-tarjeta-nom { display: flex; flex-direction: column; min-width: 0; }
.sg-tarjeta-tit { font-family: var(--font-heading); font-size: 14.5px; line-height: 1.2; color: var(--sg-navy); overflow-wrap: anywhere; }
.sg-tarjetas[data-tam="sm"] .sg-tarjeta-tit { font-size: 13px; }
.sg-tarjeta-sub, .sg-tarjeta-sub2 { font-size: 12.5px; line-height: 1.35; color: var(--color-neutral-700); }
.sg-tarjeta-sub2 { color: var(--color-neutral-600); }
.sg-tarjeta-sub:empty, .sg-tarjeta-sub2:empty { display: none; }
.sg-tarjeta-barra { display: block; width: 100%; height: 6px; background: var(--color-neutral-200); }
.sg-tarjeta-barra[data-on="0"] { display: none; }
/* «Ver más» bajo una lista larga de tarjetas (obras, equipamientos) */
.sg-tarjetas-mas { margin-top: var(--space-3); }
.sg-tarjeta-barra-f { fill: var(--c, var(--color-accent-500)); }
.sg-tarjeta-pie { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.sg-tarjeta-pie:empty { display: none; }
.sg-tarjeta-cifra { display: flex; align-items: baseline; gap: 4px; }
.sg-tarjeta-cifra-v { font-family: var(--font-heading); font-size: 15px; font-weight: 700; color: var(--sg-ink); }
.sg-tarjeta-cifra-k { font-size: 11.5px; color: var(--color-neutral-700); }
/* Los colores claros de la paleta no se leen como texto sobre blanco: el sello ya los lleva de fondo */
.sg-tarjeta[data-pf="I"], .sg-tarjeta[data-pf="J"], .sg-tarjeta[data-pf="K"], .sg-tarjeta[data-pf="L"],
.sg-tarjeta[data-pf="M"], .sg-tarjeta[data-pf="N"] { border-top-color: var(--c); }

/* ---------- Formularios ---------- */
.sg-form { max-width: 720px; }
.sg-form-section { margin-bottom: var(--space-6); }
.sg-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }
.sg-form-label { font-size: 12px; color: var(--color-neutral-700); }
.sg-form-note { display: block; margin-top: 3px; font-size: 12px; color: var(--color-neutral-600); }
/* Un campo puede ocupar una columna (por defecto), dos o la fila entera */
.sg-form-label[data-ancho="medio"] { grid-column: span 2; }
.sg-form-label[data-ancho="todo"] { grid-column: 1 / -1; }
/* Las casillas se reparten en columnas: apretadas en una sola fila no se leen (diez intervenciones) */
.sg-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; margin-top: 6px; }
.sg-check { display: flex; gap: 7px; align-items: center; padding: 5px 0; font-size: 14px; color: var(--color-text); }
.sg-check input { width: 17px; height: 17px; flex: none; accent-color: var(--jv-azul); }
@media (max-width: 760px) {
  .sg-form-label[data-ancho="medio"], .sg-form-label[data-ancho="todo"] { grid-column: 1 / -1; }
}
.sg-form-error { font-size: 13px; color: var(--sg-danger); min-height: 20px; white-space: pre-line; }
.sg-gate { max-width: 460px; border: 1px solid var(--color-neutral-300); padding: var(--space-4); background: #fff; }
.sg-gate-text { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--color-neutral-800); }

/* ---------- Ventana de inicio de sesión ---------- */
.sg-modal-backdrop { position: fixed; inset: 0; background: rgba(32,30,29,.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.sg-modal { background: #fff; padding: var(--space-6); width: 440px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.sg-modal-sub { margin: 0 0 16px; font-size: 13px; color: var(--color-neutral-700); line-height: 1.5; }
.sg-modal-error { font-size: 13px; color: var(--sg-danger); min-height: 18px; margin: 8px 0; }
.sg-demo-title { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-neutral-600); }

/* ---------- Adaptación a tablet y celular ---------- */

/* Pantallas medianas: el panel de detalle del mapa pasa debajo del mapa */
@media (max-width: 1200px) {
  .sg-map-layout { grid-template-columns: minmax(0, 1fr); }
  .sg-panel { min-height: 0; contain: none; max-height: 60vh; }
  .sg-map { height: 62vh; }
}

/* Tablet vertical y celular: menú desplegable arriba, contenido a todo el ancho */
@media (max-width: 900px) {
  .sg-app { flex-direction: column; }
  .sg-side { position: sticky; top: 0; z-index: 40; height: auto; flex: none; width: 100%; padding: 10px 0; gap: 0;
    background: var(--color-bg); border-right: 0; border-bottom: 1px solid var(--color-neutral-300); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
  .sg-brand { font-size: 16px; }
  .sg-logo { width: 104px; margin-bottom: 2px; }
  .sg-menu-btn { display: inline-block; min-height: 40px; }
  .sg-side-toggle { display: none; }          /* en pantallas pequeñas el menú se despliega con «Menú» */
  .sg-side-scroll, .sg-side-foot { display: none; }
  .sg-side[data-open="1"] .sg-side-scroll { display: block; max-height: 62vh; margin-top: 8px; border-top: 1px solid var(--color-neutral-300); }
  .sg-side[data-open="1"] .sg-side-foot { display: block; padding-bottom: 4px; }
  .sg-nav { padding: 11px 14px; }
  .sg-main { padding: var(--space-4) 16px 60px; }
  .sg-h1 { font-size: 24px; }
  .sg-header { margin-bottom: var(--space-3); }
  .sg-actions { width: 100%; }

  /* Filtros del mapa plegables; en computador siempre visibles */
  .sg-filters-btn { display: block; width: 100%; margin-bottom: 10px; text-align: left; }
  .sg-toolbar[data-open="0"] { display: none; }

  /* Filtros en cuadrícula de dos columnas */
  .sg-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
  .sg-toolbar > .sg-field:first-child { grid-column: 1 / -1; }
  .sg-toolbar .sg-field { min-width: 0; }
  .sg-toolbar .sg-count { grid-column: 1 / -1; }
  .sg-toggle { padding-bottom: 0; min-height: 32px; }
  .sg-in--search, .sg-in--search-sm { width: 100%; }
  /* Sin mouse no hay «pasar por encima»: el buscador va siempre desplegado y a todo el ancho */
  .sg-search, .sg-search:hover, .sg-search:focus-within, .sg-search[data-has="1"] { width: 100%; grid-column: 1 / -1; height: 40px; }
  .sg-search .sg-in--search { opacity: 1; width: auto; }
  .sg-search-list { width: 100%; max-width: none; }
  .sg-in, .sg-b, .sg-b2 { min-height: 40px; }        /* áreas táctiles cómodas */

  /* Mapa */
  .sg-map { height: 58vh; min-height: 340px; }
  .sg-legend { font-size: 11px; padding: 6px 8px; max-width: 62%; line-height: 1.4; }
  .sg-zoom .sg-b2 { width: 42px; height: 42px; }
  .sg-minimap { height: 280px; }

  /* Tablero y tablas */
  .sg-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
  .sg-kpi-num { font-size: 28px; }
  .sg-cols, .sg-detail-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .sg-barrow-label { width: 96px; }
  .sg-barrow-value { width: 84px; }
  .sg-t { font-size: 13px; }
  .sg-t th, .sg-t td { padding: 6px 8px; }
  .sg-fichas { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: var(--space-2); }
  .sg-ficha { padding: 8px 10px; }
  .sg-ficha-v { font-size: 23px; }
  .sg-tarjetas, .sg-tarjetas[data-tam="sm"] { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2); }
  /* Las tarjetas con varias líneas de texto (tipos de actividad) van a una sola columna en el teléfono */
  .sg-tarjetas[data-tam="ancha"] { grid-template-columns: minmax(0, 1fr); }
  .sg-tarjeta { padding: 9px 10px 10px; }
  .sg-tarjeta-sello { width: 32px; height: 32px; font-size: 14px; }
  .sg-pestanas { gap: 6px; margin-bottom: var(--space-3); }
  .sg-car-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .sg-car { grid-template-columns: 62px minmax(0, 1fr); }
  .sg-car-dia { font-size: 26px; }
  .sg-car-mes-tit { font-size: 21px; gap: var(--space-3); }
  .sg-pestana { padding: 7px 12px; font-size: 13px; }

  /* Formularios y ventana de inicio de sesión */
  .sg-form-grid { grid-template-columns: minmax(0, 1fr); }
  .sg-modal { padding: 20px 16px; }
}

/* Celular angosto */
@media (max-width: 480px) {
  .sg-h1 { font-size: 22px; }
  .sg-sub { font-size: 13px; }
  .sg-map { height: 52vh; min-height: 300px; }
  .sg-legend-row { gap: 4px; }
  .sg-modal-backdrop { padding: 0; align-items: stretch; }
  .sg-modal { width: 100%; max-height: 100vh; }
}

/* Pantallas táctiles: sin coordenadas de cursor */
@media (hover: none) {
  .sg-cursor { display: none; }
}

@media print { .sg-noprint { display: none !important; }
  .sg-panel { contain: none; overflow: visible; max-height: none; } }

/* Capas temáticas del GADM en el panel del mapa (el color de cada capa llega como regla
   [data-capa="<clave>"] generada desde el catálogo). Cada grupo es una tarjeta con icono y una
   frase en lenguaje llano; cada capa, un interruptor del color de la capa, su descripción y
   cuántos elementos trae. Al encenderla, la fila se tiñe con ese color. */
.sg-help--tight { margin-top: 2px; }
.sg-capas-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 0;
  padding: 6px 12px; border-radius: 999px; background: var(--color-accent-100); font-size: 12px; font-weight: 600; color: var(--color-accent-700); }
.sg-capas-clear { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--color-accent-700); text-decoration: underline; cursor: pointer; }
.sg-capa-grupo { margin: 10px 0 0; padding: 8px 10px 6px; border: 1px solid var(--color-neutral-300); border-radius: 10px; background: #fff; }
.sg-capa-grupo-head { display: flex; gap: 9px; align-items: center; margin-bottom: 4px; }
.sg-capa-icono { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--g, var(--jv-azul)) center / 20px no-repeat; }
.sg-capa-group { margin: 0; font-family: var(--font-heading); font-weight: 700; font-size: 14px; line-height: 1.2; color: var(--sg-navy); }
.sg-capa-grupo-help { margin: 0; font-size: 11px; line-height: 1.3; color: var(--color-neutral-700); }
.sg-capa-grupo-help:empty { display: none; }
/* Un color de la paleta y un icono por grupo */
[data-grupo="Movilidad"]     { --g: var(--jv-azul); }
[data-grupo="Planificación"] { --g: var(--jv-morado); }
[data-grupo="Ambiente"]      { --g: var(--jv-verde); }
[data-grupo="Demarcación"]   { --g: var(--jv-naranja-2); }
[data-grupo="Comunidades"]   { --g: var(--jv-petroleo); }
[data-grupo="Movilidad"] .sg-capa-icono { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='15' rx='3'/%3E%3Cpath d='M4 10h16M8 21v-3M16 21v-3'/%3E%3Ccircle cx='8' cy='14.5' r='1' fill='%23fff'/%3E%3Ccircle cx='16' cy='14.5' r='1' fill='%23fff'/%3E%3C/svg%3E"); }
[data-grupo="Planificación"] .sg-capa-icono { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M3 12h18M12 3v18'/%3E%3C/svg%3E"); }
[data-grupo="Ambiente"] .sg-capa-icono { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11z'/%3E%3C/svg%3E"); }
[data-grupo="Demarcación"] .sg-capa-icono { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v16H4z' stroke-dasharray='3 3'/%3E%3C/svg%3E"); }
[data-grupo="Comunidades"] .sg-capa-icono { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7M5 10v10h14V10'/%3E%3C/svg%3E"); }
.sg-capa { display: flex; gap: 9px; align-items: center; padding: 6px 6px; margin: 2px -4px; border-radius: 7px; font-size: 13px; cursor: pointer; transition: background .15s; }
.sg-capa:hover { background: var(--color-neutral-100, #f4f3f2); }
.sg-capa[data-on="1"] { background: color-mix(in srgb, var(--c, #9b9797) 13%, #fff); }
/* Interruptor: se pinta del color de la capa al encenderla */
.sg-switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 36px; height: 20px; margin: 0;
  border-radius: 999px; background: var(--color-neutral-400, #c9c6c3); cursor: pointer; transition: background .15s; }
.sg-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.sg-switch:checked { background: var(--c, var(--jv-azul)); }
.sg-switch:checked::after { left: 18px; }
.sg-switch:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.sg-capa-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sg-capa-label { font-weight: 600; line-height: 1.2; }
.sg-capa-desc { font-size: 11px; line-height: 1.25; color: var(--color-neutral-700); }
.sg-capa-desc:empty { display: none; }
.sg-capa-count { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--color-neutral-100, #f4f3f2); color: var(--color-neutral-700); border: 1px solid transparent; }
.sg-capa[data-on="1"] .sg-capa-count { background: #fff; color: var(--sg-ink); border-color: var(--c, #9b9797); }

/* Pantalla de carga: la silueta de las 18 plataformas se va dibujando y rellenando
   mientras llegan las capas. El trazo se anima con stroke-dashoffset. */
.sg-splash { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; padding: 24px 0; }
.sg-splash-map { flex: none; width: 260px; max-width: 46vw; }
.sg-silueta { width: 100%; height: auto; display: block; }
.sg-silueta path {
  fill: var(--sg-ink); fill-opacity: 0; stroke: var(--sg-ink); stroke-width: 1.2; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;          /* con pathLength="1" todos los contornos miden lo mismo */
  animation: sg-trazo 1.8s ease-out forwards, sg-relleno 2s ease-out forwards;
}
/* Cada plataforma entra un poco después que la anterior */
.sg-silueta path:nth-child(3n+2) { animation-delay: .18s, .22s; }
.sg-silueta path:nth-child(3n)   { animation-delay: .36s, .44s; }
.sg-splash-map[data-done="1"] .sg-silueta path { fill-opacity: .12; stroke-dashoffset: 0; animation: none; }
@keyframes sg-trazo   { to { stroke-dashoffset: 0; } }
@keyframes sg-relleno { from { fill-opacity: 0; } to { fill-opacity: .1; } }
.sg-splash-text { flex: 1 1 260px; min-width: 0; }
.sg-splash-text .sg-h1 { margin: 2px 0 10px; font-size: clamp(22px, 3.4vw, 34px); line-height: 1.15; }
.sg-step { display: flex; gap: 8px; align-items: baseline; margin: 3px 0; font-size: 13px; color: var(--color-neutral-700); }
.sg-step-mark { flex: none; width: 14px; font-variant-numeric: tabular-nums; }
.sg-step[data-state="listo"] { color: var(--sg-ink); }
.sg-step[data-state="curso"] { color: var(--sg-ink); }
.sg-step[data-state="curso"] .sg-step-mark { animation: sg-parpadeo 1s steps(2, end) infinite; }
@keyframes sg-parpadeo { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .sg-silueta path { animation: none; stroke-dashoffset: 0; fill-opacity: .1; }
  .sg-step[data-state="curso"] .sg-step-mark { animation: none; }
}
@media (max-width: 600px) {
  .sg-splash { gap: 18px; }
  .sg-splash-map { width: 150px; }
}
/* Etiqueta «Reservada»: solo en capas con roles (el span vacío no cuenta como :empty, por eso el atributo) */
.sg-capa-reserva { display: none; }
.sg-capa[data-reservada="1"] .sg-capa-reserva { display: inline-block; flex: none; font-size: 10px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--color-accent-2-700, #1a7ea6); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }

/* Calendario de actividades, bajo el mapa territorial */
.sg-cal { margin-top: 20px; border-top: 1px solid var(--color-neutral-300, #d6d4d2); padding-top: 14px; }
.sg-cal-head { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.sg-cal-nav { display: flex; gap: 6px; align-items: center; }
.sg-cal-month { font-family: var(--font-heading); font-size: 15px; min-width: 9em; text-align: center; }
.sg-cal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 20px; margin-top: 12px; align-items: start; }
.sg-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.sg-cal-wd { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--color-neutral-700);
  text-align: center; padding-bottom: 2px; }
.sg-cal-day { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 5px 2px;
  background: #fff; border: 1px solid var(--color-neutral-300, #e3e1df); cursor: pointer; font: inherit; }
.sg-cal-day:hover { border-color: var(--sg-ink); }
.sg-cal-day[data-out="1"] { background: transparent; color: var(--color-neutral-700); opacity: .55; }
.sg-cal-day[data-today="1"] { border-color: var(--color-accent); border-width: 2px; }
.sg-cal-day[data-sel="1"] { background: var(--color-accent-100); border-color: var(--color-accent); }
.sg-cal-num { font-variant-numeric: tabular-nums; font-size: 13px; }
.sg-cal-dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; min-height: 7px; }
.sg-cal-dot { width: 6px; height: 6px; background: var(--c, #9b9797); }
.sg-cal-list { display: flex; flex-direction: column; gap: 6px; }
.sg-cal-item { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 6px 0; background: none;
  border: 0; border-bottom: 1px solid var(--color-neutral-200, #eceae8); cursor: pointer; font: inherit; }
.sg-cal-item:hover .sg-cal-item-title { text-decoration: underline; }
.sg-cal-item .sg-dot { margin-top: 3px; }
.sg-cal-item-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sg-cal-item-title { font-size: 13px; }
.sg-cal-item .sg-muted { font-size: 12px; }
@media (max-width: 900px) {
  .sg-cal-body { grid-template-columns: minmax(0, 1fr); }
  .sg-cal-day { min-height: 44px; }
}
.sg-cal-more { font-size: 10px; color: var(--color-neutral-700); line-height: 1; }
.sg-cal-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.sg-cal-acciones .sg-b, .sg-cal-acciones .sg-b2 { flex: 1 1 auto; }

/* Táctil: filas de capas y días del calendario con área cómoda para el dedo */
@media (max-width: 900px), (hover: none) {
  .sg-capa { min-height: 42px; }
  .sg-switch { width: 42px; height: 24px; }
  .sg-switch::after { width: 20px; height: 20px; }
  .sg-switch:checked::after { left: 20px; }
  .sg-cal-day { min-height: 46px; }
  .sg-cal-item { padding: 9px 0; }
  .sg-cal-nav .sg-b2 { min-width: 44px; }
}

/* Cronograma por tipo de actividad (pensado también para imprimir) */
.sg-cron { border: 1px solid var(--color-neutral-300, #d6d4d2); background: #fff; }
.sg-cron-head { background: var(--color-accent); color: #fff; padding: 20px 22px 18px; position: relative; }
.sg-cron-marca { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.sg-cron-title { margin: 4px 0 2px; font-family: var(--font-display); font-weight: 900; font-size: clamp(22px, 3.2vw, 34px); line-height: 1.1; }
.sg-cron-period { margin: 0; font-size: 14px; opacity: .9; }
.sg-cron-badge { position: absolute; right: 22px; bottom: 18px; margin: 0; padding: 6px 14px; border-radius: 999px;
  background: var(--color-accent-2-700, #1a7ea6); color: #fff; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.sg-cron-dept { margin: 8px 0 0; font-size: 12px; opacity: .75; }
.sg-cron-stats { display: flex; flex-wrap: wrap; gap: 18px 28px; padding: 14px 22px; border-bottom: 1px solid var(--color-neutral-300); }
.sg-cron-stat { margin: 0; font-size: 13px; }
.sg-cron-stat strong { font-family: var(--font-heading); font-size: 20px; margin-right: 4px; }
.sg-cron-table { padding: 4px 10px 10px; }
.sg-cron-row { display: grid; grid-template-columns: 42px 86px minmax(150px, 250px) 128px minmax(0, 1fr) 104px;
  gap: 10px; align-items: center; width: 100%; padding: 7px 12px; background: none; border: 0;
  border-bottom: 1px solid var(--color-neutral-200, #eceae8); font: inherit; text-align: left; cursor: pointer; }
.sg-cron-row:hover:not([data-gap="1"]):not(.sg-cron-row--head) { background: var(--color-accent-100); }
.sg-cron-row--head { cursor: default; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-neutral-700); border-bottom: 2px solid var(--sg-ink); }
.sg-cron-dow { font-size: 11px; letter-spacing: .06em; color: var(--color-accent-2-700, #1a7ea6); font-weight: 700; }
.sg-cron-date { font-family: var(--font-heading); font-size: 16px; white-space: nowrap; }
.sg-cron-pf { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--c, var(--sg-navy));
  color: var(--fg, #fff); font-size: 13px; font-weight: 700; letter-spacing: .02em; text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.sg-cron-pf:empty, .sg-cron-note:empty, .sg-cron-estado:empty { display: none; }
.sg-cron-time { font-size: 15px; white-space: nowrap; }
.sg-cron-note { font-size: 12px; color: var(--color-neutral-700); overflow: hidden; text-overflow: ellipsis; }
/* El estado se lee en tinta oscura con un punto del color del semáforo: el amarillo (#e0a800) sobre blanco daba 2,2:1 */
.sg-cron-estado { font-size: 12px; color: var(--sg-ink, #1a1a1a); white-space: nowrap; }
.sg-cron-estado::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0;
  background: var(--c, var(--color-neutral-700)); border: 1px solid rgba(0,0,0,.25); }
.sg-cron-row[data-gap="1"] { background: var(--color-neutral-100, #f4f3f2); cursor: default; }
.sg-cron-row[data-gap="1"] .sg-cron-date { color: var(--color-neutral-700); }
.sg-cron-row[data-gap="1"] .sg-cron-note { grid-column: 3 / -1; font-size: 14px; color: var(--color-neutral-700); }
.sg-cron-pie { margin: 0; padding: 12px 22px 16px; font-size: 12px; color: var(--color-neutral-700);
  border-top: 1px solid var(--color-neutral-300); }

/* Color de cada plataforma en las píldoras del cronograma: los 14 colores de la paleta de marca.
   Los claros (celestes, amarillos, naranja y verde claro) llevan texto en tinta para que se lean. */
[data-pf="A"] { --c: var(--jv-azul); }       [data-pf="B"] { --c: var(--jv-verde); }      [data-pf="C"] { --c: var(--jv-naranja-2); }
[data-pf="D"] { --c: var(--jv-petroleo); }   [data-pf="E"] { --c: var(--jv-morado); }     [data-pf="F"] { --c: var(--jv-rojo); }
[data-pf="G"] { --c: var(--jv-fucsia); }     [data-pf="H"] { --c: var(--jv-rosa); }       [data-pf="I"] { --c: var(--jv-celeste); --fg: var(--sg-ink); }
[data-pf="J"] { --c: var(--jv-amarillo-2); --fg: var(--sg-ink); } [data-pf="K"] { --c: var(--jv-naranja); --fg: var(--sg-ink); } [data-pf="L"] { --c: var(--jv-verde-2); --fg: var(--sg-ink); }
[data-pf="M"] { --c: var(--jv-celeste-2); --fg: var(--sg-ink); } [data-pf="N"] { --c: var(--jv-amarillo); --fg: var(--sg-ink); } [data-pf="Ñ"] { --c: var(--sg-navy); }
/* Parroquia rural: píldora clara con borde, para distinguirla de las plataformas urbanas */
[data-pf="rural"] { --c: #fff; --fg: var(--sg-navy); box-shadow: inset 0 0 0 2px var(--sg-navy); }
[data-pf="O"] { --c: var(--jv-petroleo); }   [data-pf="P"] { --c: var(--jv-rojo); }       [data-pf="Q"] { --c: var(--jv-morado); }

@media (max-width: 900px) {
  .sg-cron-row { grid-template-columns: 38px 74px minmax(0, 1fr); row-gap: 4px; padding: 10px 8px; }
  .sg-cron-time { grid-column: 2 / -1; font-size: 13px; }
  .sg-cron-note, .sg-cron-estado { grid-column: 2 / -1; }
  .sg-cron-row--head .sg-cron-pf-h, .sg-cron-row--head .sg-cron-time,
  .sg-cron-row--head .sg-cron-note, .sg-cron-row--head .sg-cron-estado { display: none; }
  .sg-cron-head { padding: 16px; }
  .sg-cron-badge { position: static; display: inline-block; margin-top: 10px; }
  .sg-cron-stats { gap: 10px 18px; padding: 12px 16px; }
}

@media print {
  .sg-cron { border: 0; }
  .sg-cron-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sg-cron-pf { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sg-cron-row { break-inside: avoid; }
}
.sg-cron-badge:empty, .sg-cron-dept:empty { display: none; }
/* En las filas sin jornada no hay plataforma ni estado que mostrar */
.sg-cron-row[data-gap="1"] .sg-cron-pf,
.sg-cron-row[data-gap="1"] .sg-cron-time,
.sg-cron-row[data-gap="1"] .sg-cron-estado { display: none; }

/* Leyenda de símbolos de punto (mismo dibujo que los marcadores del mapa) */
.sg-sym { display: inline-block; width: 18px; height: 18px; flex: none; background: center / contain no-repeat; }
.sg-sym[data-sym="comunidad"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Ccircle r='8.5' fill='%2300796f' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='-2.3' cy='-1.6' r='1.5' fill='%23fff'/%3E%3Ccircle cx='2.3' cy='-1.6' r='1.5' fill='%23fff'/%3E%3Cpath d='M-4.8 3.4q2.5-4.6 5 0M-.2 3.4q2.5-4.6 5 0' fill='%23fff'/%3E%3C/svg%3E"); }
.sg-sym[data-sym="poblado"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Ccircle r='8.5' fill='%238a5a00' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M-4 -.2 0-4l4 3.8zM-2.8-.2h5.6v3.8h-5.6z' fill='%23fff'/%3E%3C/svg%3E"); }
.sg-sym[data-sym="poblado-sn"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Ccircle r='5' fill='%23b89b6e' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E"); }
.sg-sym[data-sym="recinto"], .sg-sym[data-sym="recinto-alerta"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Crect x='-8.5' y='-8.5' width='17' height='17' rx='3' fill='%23223260' stroke='%23fff' stroke-width='1.5'/%3E%3Crect x='-1.9' y='-4.4' width='3.8' height='3.6' fill='%23fff'/%3E%3Crect x='-4.4' y='-.6' width='8.8' height='5' rx='.6' fill='%23fff'/%3E%3Crect x='-2.6' y='-.9' width='5.2' height='1' fill='%23223260'/%3E%3C/svg%3E"); }
.sg-sym[data-sym="recinto-alerta"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Crect x='-8.5' y='-8.5' width='17' height='17' rx='3' fill='%23223260' stroke='%23E83F44' stroke-width='2.4'/%3E%3Crect x='-1.9' y='-4.4' width='3.8' height='3.6' fill='%23fff'/%3E%3Crect x='-4.4' y='-.6' width='8.8' height='5' rx='.6' fill='%23fff'/%3E%3Crect x='-2.6' y='-.9' width='5.2' height='1' fill='%23223260'/%3E%3C/svg%3E"); }
.sg-sym[data-sym="equipamiento"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Ccircle r='5' fill='%23223260' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E"); }
.sg-sym[data-sym="parque"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Ccircle r='9' fill='%232e8b57' stroke='%23fff' stroke-width='1.6'/%3E%3Ccircle cx='0' cy='-1.9' r='3.5' fill='%23fff'/%3E%3Crect x='-.85' y='.7' width='1.7' height='4.1' fill='%23fff'/%3E%3C/svg%3E"); }
.sg-sym[data-sym="obra"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0-7 6.6 5.2H-6.6z' fill='%232e8b57' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.sg-mark:hover > :nth-child(2) { filter: brightness(1.15); }

/* ---------- Resumen para la Alcaldía ----------
   Una cifra grande, cuatro tarjetas, el semáforo de las 18 plataformas como mosaico
   y la agenda próxima. Los colores del semáforo llegan por data-tl (--c y --fg). */
.sg-res-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 18px 24px; margin-bottom: var(--space-4); background: var(--jv-azul); color: #fff; border-radius: 4px; }
.sg-res-hero-num { margin: 0; font-size: 52px; line-height: 1; font-family: var(--font-display); font-weight: 900; color: #fff; white-space: nowrap; }
.sg-res-hero-label { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.sg-res-hero-detail { margin: 4px 0 0; font-size: 14px; opacity: .85; line-height: 1.4; }
.sg-res-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.sg-res-card { border: 1px solid var(--color-neutral-300); border-top: 4px solid var(--c, var(--color-accent)); background: #fff; padding: 14px 16px; }
.sg-res-card-num { margin: 0; font-size: 36px; line-height: 1; font-family: var(--font-heading); color: var(--sg-navy); }
.sg-res-card-label { margin: 6px 0 0; font-size: 15px; font-weight: 600; }
.sg-res-card-note { margin: 2px 0 0; font-size: 13px; color: var(--color-neutral-700); line-height: 1.4; }
.sg-res-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: var(--space-6); align-items: start; }
.sg-res-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.sg-res-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 92px; padding: 10px 10px 8px; border: 0; border-radius: 4px; cursor: pointer; text-align: left; background: var(--c, #9b9797); color: var(--fg, #fff); font-family: var(--font-body); }
.sg-res-tile:hover { filter: brightness(1.08); }
.sg-res-tile:focus-visible { outline: 2px solid var(--sg-navy); outline-offset: 2px; }
.sg-res-tile-letter { font-size: 26px; line-height: 1; font-family: var(--font-heading); font-weight: 700; }
.sg-res-tile-name { font-size: 12px; opacity: .9; }
.sg-res-tile-status { font-size: 12px; font-weight: 600; margin-top: auto; line-height: 1.25; }
.sg-res-tile-note { font-size: 11px; opacity: .85; }
.sg-res-item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid var(--color-neutral-300); padding: 8px 10px; margin-bottom: 6px; cursor: pointer; font-family: var(--font-body); color: var(--color-text); }
.sg-res-item:hover { border-color: var(--color-accent-300); background: var(--color-accent-100); }
.sg-res-date { flex: none; width: 50px; text-align: center; background: var(--color-accent-100); color: var(--sg-navy); border-radius: 4px; padding: 5px 0; line-height: 1.1; }
.sg-res-day { display: block; font-size: 20px; font-weight: 700; font-family: var(--font-heading); }
.sg-res-month { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.sg-res-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; line-height: 1.3; }
.sg-res-item-title { font-weight: 600; }
.sg-res-alert { margin: 0 0 8px; padding: 8px 10px; font-size: 14px; line-height: 1.45; background: var(--color-accent-2-100); border-left: 3px solid var(--color-accent-2); }
@media (max-width: 900px) {
  .sg-res-cols { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .sg-res-hero { padding: 14px 16px; gap: 14px; }
  .sg-res-hero-num { font-size: 38px; }
  .sg-res-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-res-card-num { font-size: 30px; }
}
@media print {
  .sg-res-hero, .sg-res-tile, .sg-res-date, .sg-res-alert { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sg-res-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Inicio ciudadano (sin sesión) ----------
   Portada colorida al estilo del portal municipal: saludo con rótulos de color, buscador, anillo de accesos,
   cifras, el mapa con sus plataformas, la agenda próxima y la tarjeta del alcalde. Los colores llegan por
   data-color (--c fondo, --fg texto) y, en agenda y mosaico, por data-pf (color de cada plataforma). */
[data-nav="inicio"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8v10h-6v-7h-6v7H3z'/%3E%3C/svg%3E"); }
[data-nav="chat"]   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 21l1.9-5.4A8 8 0 1 1 21 12z'/%3E%3Cpath d='M8 12h.01M12 12h.01M16 12h.01'/%3E%3C/svg%3E"); }
[data-nav="sitio"]  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M4 10h16L12 4zM6 10v11M10 10v11M14 10v11M18 10v11'/%3E%3C/svg%3E"); }
[data-color="azul"]     { --c: var(--jv-azul);       --fg: #fff; }
[data-color="rosa"]     { --c: var(--jv-rosa);       --fg: #fff; }
[data-color="verde"]    { --c: var(--jv-verde);      --fg: #fff; }
[data-color="morado"]   { --c: var(--jv-morado);     --fg: #fff; }
[data-color="celeste"]  { --c: var(--jv-celeste);    --fg: var(--sg-navy); }
[data-color="amarillo"] { --c: var(--jv-amarillo-2); --fg: var(--sg-navy); }
[data-color="naranja"]  { --c: var(--jv-naranja);    --fg: var(--sg-navy); }
[data-color="navy"]     { --c: var(--sg-navy);       --fg: #fff; }

.sg-ini { --ini-radius: 22px; }
.sg-ini-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr); gap: 32px; align-items: center; margin-bottom: 28px; }
/* Con foto de fondo: el bloque se vuelve una tarjeta con la imagen detrás y un velo blanco que se desvanece hacia la derecha,
   así los rótulos de color quedan sobre fondo claro y la chacana flota sobre la foto */
/* Con foto: el texto baja para dejar libre el rincón superior izquierdo, donde queda el rostro del alcalde */
.sg-ini-hero[data-foto="true"] { position: relative; isolation: isolate; overflow: hidden; padding: 170px 28px 30px; min-height: 600px; box-sizing: border-box; border-radius: var(--ini-radius); background: #e9eef5; box-shadow: 0 10px 28px rgba(19,47,91,.14); }
/* La foto se ancla abajo (object-position 100%): así el alcalde, que está arriba a la izquierda de la imagen, queda visible sobre el texto */
.sg-ini-hero-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; z-index: -2; }
/* Velo: casi transparente arriba (rostro del alcalde), blanco donde va el texto y suave abajo y a la derecha, para que el resto de la foto se siga viendo */
.sg-ini-hero-velo { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(176deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.14) 28%, rgba(255,255,255,.36) 52%, rgba(255,255,255,.34) 78%, rgba(255,255,255,.16) 100%); }
/* Pantallas anchas: el bloque es más apaisado y se ve menos foto; el encuadre sube para que las caras queden dentro */
@media (min-width: 1250px) { .sg-ini-hero[data-foto="true"] { min-height: 640px; padding-top: 200px; } }
.sg-ini-hero[data-foto="true"] .sg-ini-tile, .sg-ini-hero[data-foto="true"] .sg-ini-ring-center { box-shadow: 0 8px 18px rgba(19,47,91,.28); }
.sg-ini-hero[data-foto="true"] .sg-ini-chip { background: rgba(255,255,255,.92); }
.sg-ini-hero-text { min-width: 0; position: relative; }
.sg-ini-tag { display: inline-block; margin: 0; padding: 4px 14px; font-family: var(--font-display); font-weight: 900; font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.15; color: #fff; background: var(--c, var(--jv-azul)); transform: rotate(-1.5deg); border-radius: 3px; }
.sg-ini-tag--azul { --c: var(--jv-azul); }
.sg-ini-tag--morado { --c: var(--jv-morado); margin-top: 6px; }
.sg-ini-tag--rosa { --c: var(--jv-rosa); font-size: clamp(26px, 3.4vw, 42px); transform: rotate(-1.5deg) translateY(2px); }
.sg-ini-title { display: inline-block; margin: 6px 0 2px; padding: 2px 18px 6px; font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(54px, 7.5vw, 96px); line-height: 1; color: var(--sg-navy); background: var(--jv-amarillo); transform: rotate(-1.5deg); border-radius: 3px; }
.sg-ini-search { display: flex; align-items: center; gap: 8px; margin: 26px 0 14px; padding: 6px 6px 6px 16px; max-width: 560px;
  background: #fff; border: 3px solid var(--sg-navy); border-radius: 999px; box-shadow: 6px 6px 0 var(--jv-celeste); }
.sg-ini-search-ico { flex: none; width: 20px; height: 20px; background: var(--jv-azul);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.sg-ini-search-in { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--sg-ink); padding: 8px 0; }
.sg-ini-search-in::placeholder { color: var(--color-neutral-700); }
.sg-ini-search-btn { flex: none; border: 0; border-radius: 999px; padding: 11px 20px; background: var(--jv-rosa); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.sg-ini-search-btn:hover { background: #b8134f; }
.sg-ini-search:focus-within { box-shadow: 6px 6px 0 var(--jv-azul); }
.sg-ini-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-ini-chip { border: 2px solid var(--c, var(--sg-navy)); border-radius: 999px; padding: 8px 16px; background: #fff; color: var(--sg-navy); font-weight: 700; font-size: 14px; cursor: pointer; }
.sg-ini-chip:hover { background: var(--c, var(--sg-navy)); color: var(--fg, #fff); }

/* Chacana de accesos: cruz escalonada sobre una rejilla de 12 × 12 pasos (el cuadro es cuadrado: aspect-ratio).
   Brazos y círculo central ocupan 4 pasos (cuadrados iguales); las esquinas ocupan 3 pasos y van pegadas al centro,
   medio paso por dentro del borde, así la silueta escalona como una chacana. Al pasar el mouse cada ficha crece. */
.sg-ini-ring { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(12, minmax(0, 1fr)); gap: 6px;
  width: min(100%, 520px); aspect-ratio: 1; margin: 0 auto; }
.sg-ini-ring-center { grid-area: 5 / 5 / 9 / 9; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 9%; border-radius: 50%; border: 4px solid #fff;
  background: conic-gradient(var(--jv-amarillo) 0 25%, var(--jv-rosa) 25% 50%, var(--jv-verde-2) 50% 75%, var(--jv-azul) 75% 100%); box-shadow: 0 8px 18px rgba(19,47,91,.2); }
/* Carrusel del centro: las fotos se cruzan con CSS, sin temporizadores ni redibujos de la app.
   Debajo queda el logotipo, que es lo que se ve mientras cargan y si el navegador no anima. */
.sg-ini-fotos { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #fff; }
.sg-ini-fotos img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.sg-ini-foto-base { object-fit: contain; padding: 18%; box-sizing: border-box; }
.sg-ini-foto { object-fit: cover; opacity: 0; animation: sg-carrusel 36s linear infinite; }
/* Cada foto se ve 6 s de los 36 del ciclo; los bordes del fotograma se solapan para que el cruce no deje hueco */
@keyframes sg-carrusel { 0%, 14% { opacity: 1; } 17%, 97% { opacity: 0; } 100% { opacity: 1; } }
.sg-ini-foto[data-i="1"] { animation-delay: -30s; }
.sg-ini-foto[data-i="2"] { animation-delay: -24s; }
.sg-ini-foto[data-i="3"] { animation-delay: -18s; }
.sg-ini-foto[data-i="4"] { animation-delay: -12s; }
.sg-ini-foto[data-i="5"] { animation-delay: -6s; }
.sg-ini-ring-center:hover .sg-ini-foto { animation-play-state: paused; }   /* al pasar el mouse se detiene */
@media (prefers-reduced-motion: reduce) {
  .sg-ini-foto { animation: none; opacity: 0; }
  .sg-ini-foto[data-i="0"] { opacity: 1; }
}
.sg-ini-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 0; padding: 10px; border: 3px solid #fff; border-radius: 22%;
  background: var(--c, var(--sg-navy)); color: var(--fg, #fff); text-decoration: none; text-align: center; font: inherit; cursor: pointer; overflow: hidden;
  box-shadow: 0 6px 14px rgba(19,47,91,.16); transition: transform .18s, box-shadow .18s; }
.sg-ini-tile[data-pos="n"] { grid-area: 1 / 5 / 5 / 9; }   .sg-ini-tile[data-pos="s"] { grid-area: 9 / 5 / 13 / 9; }
.sg-ini-tile[data-pos="w"] { grid-area: 5 / 1 / 9 / 5; }   .sg-ini-tile[data-pos="e"] { grid-area: 5 / 9 / 9 / 13; }
.sg-ini-tile[data-pos="nw"] { grid-area: 2 / 2 / 5 / 5; }  .sg-ini-tile[data-pos="ne"] { grid-area: 2 / 9 / 5 / 12; }
.sg-ini-tile[data-pos="sw"] { grid-area: 9 / 2 / 12 / 5; } .sg-ini-tile[data-pos="se"] { grid-area: 9 / 9 / 12 / 12; }
.sg-ini-tile:hover, .sg-ini-tile:focus-visible { transform: scale(1.08); box-shadow: 0 12px 24px rgba(19,47,91,.26); color: var(--fg, #fff); outline: 0; z-index: 2; }
.sg-ini-tile[data-corner="1"]:hover, .sg-ini-tile[data-corner="1"]:focus-visible { transform: scale(1.14); }
.sg-ini-tile:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--sg-navy); }
.sg-ini-tile-ico { flex: none; width: 34px; height: 34px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.sg-ini-tile[data-corner="1"] .sg-ini-tile-ico { width: 26px; height: 26px; }
.sg-ini-tile-label { font-family: var(--font-heading); font-weight: 700; font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.sg-ini-tile[data-corner="1"] .sg-ini-tile-label { font-size: 11.5px; letter-spacing: -.01em; }
.sg-ini-tile[data-corner="1"] { padding: 8px; }

/* Cifras */
.sg-ini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 30px; }
.sg-ini-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 0; border-radius: var(--ini-radius); text-align: left; font: inherit; cursor: pointer;
  background: var(--c, var(--sg-navy)); color: var(--fg, #fff); box-shadow: 0 6px 14px rgba(19,47,91,.14); transition: transform .15s; }
.sg-ini-kpi:hover { transform: translateY(-3px); }
.sg-ini-kpi-num { font-family: var(--font-display); font-weight: 900; font-size: 40px; line-height: 1; }
.sg-ini-kpi-label { font-size: 14px; font-weight: 600; line-height: 1.25; opacity: .95; }

/* Secciones */
.sg-ini-sec { margin-bottom: 34px; }
.sg-ini-sec-head { margin-bottom: 14px; }
.sg-ini-h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 900; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; color: var(--sg-navy); }
.sg-ini-h3 { margin: 0 0 10px; font-family: var(--font-heading); font-weight: 700; font-size: 20px; line-height: 1.2; color: var(--sg-navy); }
.sg-ini-mark { display: inline-block; padding: 0 10px 3px; color: #fff; background: var(--c, var(--jv-azul)); transform: rotate(-1.5deg); border-radius: 3px; }
.sg-ini-mark--azul { --c: var(--jv-azul); }
.sg-ini-mark--verde { --c: var(--jv-verde); }
.sg-ini-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: stretch; }
.sg-ini-map-frame { border: 3px solid var(--sg-navy); border-radius: var(--ini-radius); overflow: hidden; box-shadow: 8px 8px 0 var(--jv-amarillo); }
.sg-ini-map-frame .sg-map { height: 56vh; min-height: 380px; }
.sg-ini-side { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 3px solid var(--sg-navy); border-radius: var(--ini-radius); background: #fff; box-shadow: 8px 8px 0 var(--jv-celeste); }
.sg-ini-side .sg-btn-row { margin-top: 4px; }
.sg-ini-side .sg-ini-btn--block { margin-top: auto; }
.sg-ini-pfs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.sg-ini-pf { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 5px; border: 2px solid transparent; border-radius: 10px;
  background: var(--c, #9b9797); color: var(--fg, #fff); font: inherit; cursor: pointer; transition: transform .12s; min-width: 0; }
.sg-ini-pf:hover { transform: scale(1.06); }
.sg-ini-pf[data-on="1"] { border-color: var(--sg-ink); box-shadow: 0 0 0 2px #fff inset; }
.sg-ini-pf-letter { font-family: var(--font-heading); font-weight: 700; font-size: 18px; line-height: 1; }
.sg-ini-pf-note { font-size: 9.5px; line-height: 1.1; text-align: center; opacity: .9; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Fichas de parroquias bajo las plataformas: verde para las rurales, azul para las urbanas */
.sg-ini-pq-title { margin-top: 6px; }
.sg-ini-pqs { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-ini-pq { padding: 6px 11px; border: 2px solid var(--c, var(--jv-verde)); border-radius: 999px; background: #fff; color: var(--c, var(--jv-verde));
  font: inherit; font-size: 13px; font-weight: 700; line-height: 1.1; cursor: pointer; transition: transform .12s, background .12s, color .12s; }
.sg-ini-pq[data-zona="urbana"] { --c: var(--jv-azul); }
.sg-ini-pq:hover { transform: scale(1.05); }
.sg-ini-pq[data-on="1"], .sg-ini-pq:active { background: var(--c, var(--jv-verde)); color: #fff; }
.sg-ini-pq:focus-visible { outline: 2px solid var(--sg-navy); outline-offset: 2px; }

/* Agenda próxima en tarjetas */
.sg-ini-agenda { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 14px; }
.sg-ini-card { display: flex; gap: 12px; align-items: stretch; padding: 0; border: 2px solid var(--color-neutral-300); border-radius: 18px; overflow: hidden;
  background: #fff; text-align: left; font: inherit; color: var(--sg-ink); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.sg-ini-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(19,47,91,.14); border-color: var(--c, var(--sg-navy)); }
.sg-ini-card[data-today="1"] { border-color: var(--jv-rosa); }
.sg-ini-card-date { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 74px; padding: 10px 4px;
  background: var(--c, var(--sg-navy)); color: var(--fg, #fff); line-height: 1; }
.sg-ini-card-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.sg-ini-card-day { font-family: var(--font-display); font-weight: 900; font-size: 32px; margin: 3px 0 2px; }
.sg-ini-card-month { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.sg-ini-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 12px 12px 0; }
.sg-ini-card-pf { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--sg-navy)); }
.sg-ini-card[data-pf="I"] .sg-ini-card-pf, .sg-ini-card[data-pf="J"] .sg-ini-card-pf, .sg-ini-card[data-pf="K"] .sg-ini-card-pf, .sg-ini-card[data-pf="L"] .sg-ini-card-pf,
.sg-ini-card[data-pf="M"] .sg-ini-card-pf, .sg-ini-card[data-pf="N"] .sg-ini-card-pf { color: var(--sg-navy); }   /* los colores claros no se leen como texto */
.sg-ini-card-title { font-family: var(--font-heading); font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--sg-navy); }
.sg-ini-card-meta { font-size: 12.5px; color: var(--color-neutral-700); line-height: 1.3; }
.sg-ini-card-place { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Botones de color (enlaces o botones) */
.sg-ini-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 2px solid var(--c, var(--sg-navy)); border-radius: 999px;
  background: var(--c, var(--sg-navy)); color: var(--fg, #fff); font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .12s; }
.sg-ini-btn:hover { transform: translateY(-2px); color: var(--fg, #fff); }
.sg-ini-btn--azul { --c: var(--jv-azul); --fg: #fff; }
.sg-ini-btn--verde { --c: var(--jv-verde); --fg: #fff; }
.sg-ini-btn--rosa { --c: var(--jv-rosa); --fg: #fff; }
.sg-ini-btn--naranja { --c: var(--jv-naranja); --fg: var(--sg-navy); }
.sg-ini-btn--blanco { --c: #fff; --fg: var(--sg-navy); border-color: var(--sg-navy); }
.sg-ini-btn--block { width: 100%; }
.sg-ini-btn-ico { width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }

/* Tarjeta del alcalde y franja de colores */
.sg-ini-alcalde { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 26px; align-items: center; padding: 26px 30px; border-radius: var(--ini-radius);
  background: var(--sg-navy); color: #fff; box-shadow: 10px 10px 0 var(--jv-rosa); margin-bottom: 26px; }
.sg-ini-alcalde-logo { width: 180px; height: 180px; object-fit: contain; background: #fff; border-radius: 50%; padding: 34px; box-sizing: border-box; }
.sg-ini-alcalde-eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--jv-amarillo); font-weight: 700; }
.sg-ini-alcalde-name { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; color: #fff; }
.sg-ini-alcalde-cargo { margin: 4px 0 10px; font-size: 16px; font-weight: 600; color: var(--jv-celeste); }
.sg-ini-alcalde-msg { margin: 0; font-size: 15px; line-height: 1.5; max-width: 60ch; opacity: .92; }
.sg-ini-rainbow { height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, var(--jv-morado) 0 14.3%, var(--jv-azul) 14.3% 28.6%, var(--jv-verde) 28.6% 42.9%, var(--jv-celeste) 42.9% 57.2%,
    var(--jv-amarillo) 57.2% 71.5%, var(--jv-naranja) 71.5% 85.8%, var(--jv-rosa) 85.8% 100%); }

@media (max-width: 1200px) {
  .sg-ini-map-layout { grid-template-columns: minmax(0, 1fr); }
  /* En pantallas medianas la chacana va debajo del saludo, a su tamaño completo, en vez de apretarse a un lado */
  .sg-ini-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sg-ini-map-frame .sg-map { height: 52vh; }
  .sg-ini-pfs { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sg-ini-hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .sg-ini-hero[data-foto="true"] { padding: 22px 16px; }
  .sg-ini-hero-velo { background: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.9) 45%, rgba(255,255,255,.6) 70%, rgba(255,255,255,.3) 100%); }
  .sg-ini-hero-foto { object-position: 50% 15%; }
  .sg-ini-ring { width: min(100%, 440px); gap: 4px; }
  .sg-ini-tile { padding: 6px; border-width: 2px; gap: 5px; }
  .sg-ini-tile-ico { width: 26px; height: 26px; }
  .sg-ini-tile-label { font-size: 12.5px; }
  .sg-ini-tile[data-corner="1"] .sg-ini-tile-label { font-size: 10.5px; }
  .sg-ini-tile[data-corner="1"] .sg-ini-tile-ico { width: 20px; height: 20px; }
  .sg-ini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-ini-kpi-num { font-size: 32px; }
  .sg-ini-alcalde { grid-template-columns: minmax(0, 1fr); padding: 20px; box-shadow: 6px 6px 0 var(--jv-rosa); }
  .sg-ini-alcalde-logo { width: 130px; }
  .sg-ini-map-frame { box-shadow: 5px 5px 0 var(--jv-amarillo); }
  .sg-ini-side { box-shadow: 5px 5px 0 var(--jv-celeste); }
  .sg-ini-pfs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .sg-ini-search { flex-wrap: wrap; border-radius: 22px; padding: 8px 12px; }
  .sg-ini-search-btn { width: 100%; }
  .sg-ini-agenda { grid-template-columns: minmax(0, 1fr); }
  .sg-ini-pfs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .sg-ini-tile, .sg-ini-kpi, .sg-ini-card, .sg-ini-btn, .sg-ini-pf { transition: none; }
}

/* ---------- Administración: pestañas, listas con avatar y formulario lateral ----------
   Usuarios, roles, personas, equipo territorial y bitácora comparten el mismo patrón: pestañas arriba,
   lista con buscador a la izquierda y, cuando hace falta, el formulario a la derecha. Sin ventanas emergentes. */
.sg-adm-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 18px; background: #fff; border: 1px solid var(--color-neutral-300); border-radius: 12px; width: fit-content; max-width: 100%; }
.sg-adm-tab { border: 0; border-radius: 9px; padding: 8px 14px; background: none; color: var(--color-neutral-800); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.sg-adm-tab:hover { background: var(--color-accent-100); color: var(--color-accent-700); }
.sg-adm-tab[data-on="1"] { background: var(--sg-navy); color: #fff; }
.sg-adm-tab-n { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: rgba(0,0,0,.08); font-size: 12px; font-weight: 600; text-align: center; }
.sg-adm-tab[data-on="1"] .sg-adm-tab-n { background: rgba(255,255,255,.22); }
.sg-adm-tab-n:empty { display: none; }
.sg-adm-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
/* Equipo territorial en el menú: solo consulta, a todo el ancho y con tarjetas que no se seleccionan */
.sg-adm-split[data-solo="true"] { grid-template-columns: minmax(0, 1fr); }
.sg-adm-split[data-solo="true"] .sg-adm-card { cursor: default; }
.sg-adm-split[data-solo="true"] .sg-adm-card:hover { border-color: var(--color-neutral-300); box-shadow: none; }
.sg-adm-list { min-width: 0; }
.sg-adm-side { position: sticky; top: 12px; padding: 16px; border: 1px solid var(--color-neutral-300); border-radius: 12px; background: #fff; box-shadow: 0 6px 16px rgba(19,47,91,.06); }
.sg-adm-side .sg-form-label { display: block; margin-bottom: 10px; }
.sg-adm-side .sg-in { width: 100%; box-sizing: border-box; margin-top: 3px; }
.sg-adm-side .sg-actions { margin-top: 4px; }
.sg-adm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sg-adm-head .sg-h2 { margin: 0; }
.sg-adm-sub { font-size: 14px; font-weight: 400; color: var(--color-neutral-700); font-family: var(--font-body); margin-left: 6px; }
.sg-adm-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sg-adm-tools .sg-in { min-width: 240px; }
.sg-adm-intro { margin-bottom: 12px; }
.sg-adm-msg { padding: 10px 12px; background: var(--color-accent-2-100); border-left: 3px solid var(--color-accent-2); margin-bottom: 10px; }
.sg-adm-row { display: grid; grid-template-columns: 44px minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(120px, .9fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; margin-bottom: 6px; background: #fff; border: 1px solid var(--color-neutral-300); border-radius: 12px; }
.sg-adm-row[data-on="1"] { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-200); }
.sg-adm-row[data-inactive="1"] { opacity: .62; }
.sg-adm-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--c, var(--sg-navy)); color: var(--fg, #fff); font-family: var(--font-heading); font-weight: 700; font-size: 15px; }
.sg-adm-main, .sg-adm-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-adm-name { font-weight: 700; font-size: 15px; color: var(--sg-navy); overflow: hidden; text-overflow: ellipsis; }
.sg-adm-sub2 { font-size: 12.5px; color: var(--color-neutral-700); overflow: hidden; text-overflow: ellipsis; }
.sg-adm-chip { display: inline-block; width: fit-content; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--color-accent-100); color: var(--color-accent-700); border: 1px solid var(--color-accent-200); }
.sg-adm-chip--lg { font-size: 14px; padding: 5px 14px; }
.sg-adm-chip[data-role="admin"] { background: #fde8ee; color: #a3123f; border-color: #f7c3d2; }
.sg-adm-chip[data-role="jefe"] { background: #fff1e9; color: #a63a0f; border-color: #f8cdb6; }
.sg-adm-chip[data-role="alcalde"] { background: #f2e9fb; color: #6b1f9c; border-color: #dfc6f3; }
.sg-adm-chip[data-role="editor"], .sg-adm-chip[data-role="conversadores"], .sg-adm-chip[data-role="agenda"] { background: #e6f6fc; color: #176a8d; border-color: #bde7f5; }
.sg-adm-chip[data-role="coordinador"] { background: #e7f6ec; color: #116436; border-color: #bfe6cc; }
.sg-adm-chip[data-role="consulta"] { background: var(--color-neutral-100, #f4f3f2); color: var(--color-neutral-800); border-color: var(--color-neutral-300); }
.sg-adm-state { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sg-adm-state[data-state="activo"] { background: #e7f6ec; color: #116436; }
.sg-adm-state[data-state="temporal"], .sg-adm-state[data-state="inicial"] { background: #fff5d6; color: #7a5a00; }
.sg-adm-state[data-state="inactivo"] { background: var(--color-neutral-200, #eceae8); color: var(--color-neutral-700); }
.sg-adm-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sg-adm-actions .sg-b2 { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.sg-adm-rolehelp { margin: -4px 0 12px; line-height: 1.4; }
.sg-adm-note { margin-top: 12px; }
.sg-adm-acts { margin-top: 24px; }
.sg-adm-use { white-space: nowrap; }
.sg-adm-nowrap { white-space: nowrap; }
/* Roles y permisos */
.sg-adm-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sg-adm-role { padding: 14px 16px; background: #fff; border: 1px solid var(--color-neutral-300); border-radius: 12px; }
.sg-adm-role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sg-adm-role-desc { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; color: var(--color-neutral-800); min-height: 1.4em; }
.sg-adm-perms { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--color-neutral-800); }
/* Equipo territorial: tarjetas por plataforma */
.sg-adm-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sg-adm-card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 12px; text-align: left; font: inherit; color: var(--color-text); cursor: pointer;
  background: #fff; border: 1px solid var(--color-neutral-300); border-radius: 12px; }
.sg-adm-card:hover { border-color: var(--color-accent-300); }
.sg-adm-card[data-on="1"] { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-200); }
.sg-adm-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sg-adm-pf { padding: 4px 10px; font-size: 13px; min-width: 2.2em; }
.sg-adm-card-name { font-weight: 700; font-size: 13px; color: var(--sg-navy); }
.sg-adm-card-k { margin-top: 6px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.sg-adm-card-v { font-weight: 600; font-size: 14px; }
.sg-adm-rep { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; }
.sg-adm-rep-x { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--color-neutral-200, #eceae8); color: var(--color-neutral-800); font-size: 14px; line-height: 1; }
.sg-adm-rep-x:hover { background: var(--jv-rosa); color: #fff; }
.sg-adm-demo { margin-top: 24px; padding: 14px 16px; border: 1px dashed var(--color-neutral-400, #bab6b6); border-radius: 12px; }
/* Acta de credenciales (ventana) */
.sg-acta { width: 520px; }
.sg-acta-clave-caja { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px; margin: 6px 0 12px; background: #fff8d6; border: 2px dashed var(--jv-amarillo-2); border-radius: 10px; }
.sg-acta-clave-k { flex: 1 0 100%; margin: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #7a5a00; font-weight: 700; }
.sg-acta-clave { margin: 0; font-family: Consolas, "Courier New", monospace; font-size: 26px; letter-spacing: .14em; color: var(--sg-navy); user-select: all; }
.sg-acta-self:empty { display: none; }
@media (max-width: 1100px) {
  .sg-adm-split { grid-template-columns: minmax(0, 1fr); }
  .sg-adm-side { position: static; }
  .sg-adm-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .sg-adm-col, .sg-adm-use { grid-column: 2; }
  .sg-adm-state { grid-column: 2; }
  .sg-adm-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 600px) {
  .sg-adm-tools { width: 100%; }
  .sg-adm-tools .sg-in { min-width: 0; flex: 1; }
  .sg-adm-row { grid-template-columns: 36px minmax(0, 1fr); gap: 8px 10px; }
  .sg-adm-avatar { width: 34px; height: 34px; font-size: 13px; }
  .sg-adm-col, .sg-adm-use, .sg-adm-state, .sg-adm-actions { grid-column: 1 / -1; }
}

/* ---------- «Carga tu selfie con el Johnvi» (Inicio) ----------
   Banner con la foto «Juntos», formulario con consentimiento y galería de las selfies aprobadas. */
.sg-selfie-layout { display: grid; grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr); gap: 22px; align-items: stretch; }
.sg-selfie-banner { position: relative; border: 3px solid var(--sg-navy); border-radius: var(--ini-radius, 22px); overflow: hidden; box-shadow: 8px 8px 0 var(--jv-rosa); min-height: 280px; }
.sg-selfie-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sg-selfie-banner-tag { position: absolute; left: 16px; bottom: 14px; padding: 6px 14px; border-radius: 999px; background: var(--jv-rosa); color: #fff; font-family: var(--font-display); font-weight: 900; font-size: 20px; transform: rotate(-3deg); }
.sg-selfie-form { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border: 3px solid var(--sg-navy); border-radius: var(--ini-radius, 22px); background: #fff; box-shadow: 8px 8px 0 var(--jv-amarillo); }
.sg-selfie-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; padding: 14px; border: 2px dashed var(--jv-azul); border-radius: 14px; background: var(--color-accent-100); cursor: pointer; text-align: center; overflow: hidden; }
.sg-selfie-drop:hover { background: #dbeafd; }
.sg-selfie-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sg-selfie-drop[data-has="1"] { border-style: solid; background: #fff; }
.sg-selfie-preview { max-width: 100%; max-height: 260px; border-radius: 10px; object-fit: contain; }
.sg-selfie-drop-ico { width: 40px; height: 40px; background: var(--jv-azul);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.sg-selfie-drop[data-has="1"] .sg-selfie-drop-ico { display: none; }
.sg-selfie-drop-text { font-weight: 600; color: var(--sg-navy); font-size: 14px; }
.sg-selfie-check { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--color-neutral-800); padding: 10px 12px; border-radius: 10px; background: var(--color-neutral-100, #f4f3f2); }
.sg-selfie-check input { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.sg-selfie-check a { text-decoration: underline; }
.sg-selfie-form .sg-form-error { margin: 0; min-height: 0; }
.sg-selfie-form .sg-form-error:empty { display: none; }
.sg-selfie-ok { padding: 16px 18px; border-radius: 14px; background: #e7f6ee; border: 2px solid var(--jv-verde); color: var(--sg-navy); font-size: 15px; line-height: 1.45; }
.sg-selfie-gal-title { margin: 22px 0 10px; }
.sg-selfie-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.sg-selfie-item { display: block; position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(19,47,91,.16); transition: transform .15s; background: var(--color-neutral-200); }
.sg-selfie-item:hover { transform: translateY(-3px) rotate(-1deg); }
.sg-selfie-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-selfie-item-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(19,47,91,.85)); color: #fff; font-size: 12px; line-height: 1.25; display: flex; flex-direction: column; gap: 1px; }
.sg-selfie-item-text strong { font-size: 13px; }
.sg-selfie-item-text span:empty { display: none; }
/* Revisión en Administración → Selfies */
.sg-selfie-adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 6px 0 18px; }
.sg-selfie-adm-card { border: 1px solid var(--color-neutral-300); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.sg-selfie-adm-card[data-status="pendiente"] { border-color: var(--jv-amarillo-2); }
.sg-selfie-adm-card[data-status="aprobada"] { border-color: var(--jv-verde); }
.sg-selfie-adm-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--color-neutral-200); }
.sg-selfie-adm-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 0; font-size: 13px; }
.sg-selfie-adm-caption:empty, .sg-selfie-adm-rev:empty { display: none; }
.sg-selfie-adm-caption { font-style: italic; }
.sg-selfie-adm-rev { font-size: 12px; color: var(--color-neutral-700); }
.sg-selfie-adm-card .sg-btn-row { padding: 10px 12px 12px; margin-top: auto; }
.sg-selfie-adm-line .sg-b2 { margin-left: 8px; padding: 3px 10px; font-size: 12px; }
/* Tarjeta «Tu alcalde»: la foto en vez del logotipo */
.sg-ini-alcalde-foto { padding: 0; object-fit: cover; border: 5px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
@media (max-width: 900px) {
  .sg-selfie-layout { grid-template-columns: minmax(0, 1fr); }
  .sg-selfie-banner { min-height: 200px; box-shadow: 5px 5px 0 var(--jv-rosa); }
  .sg-selfie-form { box-shadow: 5px 5px 0 var(--jv-amarillo); }
  .sg-selfie-gal { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
}

/* ---------- Capas geográficas (Administración): importar y exportar shapes ---------- */
.sg-capas-help { margin: 0 0 var(--space-3); max-width: 920px; }
.sg-capas-msg { margin: 0 0 var(--space-4); padding: 8px 12px; font-size: 14px; line-height: 1.45; background: var(--color-accent-100); border-left: 3px solid var(--color-accent); white-space: pre-line; }
.sg-capas-msg[data-error="1"] { background: #fdeeef; border-left-color: var(--sg-danger, #a5272c); }
.sg-capas-group { margin-bottom: var(--space-5, 20px); }
.sg-capa-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--color-neutral-300); }
.sg-capa-row:hover { background: var(--color-accent-100); }
.sg-capa-geom { flex: none; width: 22px; height: 22px; background: center / contain no-repeat; }
.sg-capa-geom[data-geom="puntos"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='6' cy='7' r='3' fill='%23147BE2'/%3E%3Ccircle cx='15' cy='6' r='3' fill='%23147BE2'/%3E%3Ccircle cx='11' cy='15' r='3' fill='%23147BE2'/%3E%3C/svg%3E"); }
.sg-capa-geom[data-geom="lineas"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M2 17 L8 8 L14 13 L20 4' fill='none' stroke='%23147BE2' stroke-width='2.4' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E"); }
.sg-capa-geom[data-geom="poligonos"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M3 6 L12 2 L20 8 L17 19 L5 18 Z' fill='%23c6def9' stroke='%23147BE2' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.sg-capa-geom[data-geom="mixta"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M2 12 L9 3 L13 10 Z' fill='%23c6def9' stroke='%23147BE2' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M10 19 L20 12' stroke='%23147BE2' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='17' cy='5' r='2.6' fill='%23147BE2'/%3E%3C/svg%3E"); }
.sg-capa-row-body { flex: 1; min-width: 0; }
.sg-capa-row-title { margin: 0; font-size: 15px; font-weight: 600; }
.sg-capa-row-meta { margin: 2px 0 0; font-size: 12px; color: var(--color-neutral-700); line-height: 1.4; }
.sg-capa-row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sg-capa-row-actions .sg-b2 { padding: 5px 10px; font-size: 13px; }
.sg-capa-row-actions .sg-b2:disabled { opacity: .55; cursor: progress; }
.sg-b2--quiet { color: var(--sg-danger, #a5272c); }
@media (max-width: 700px) {
  .sg-capa-row { flex-wrap: wrap; }
  .sg-capa-row-body { flex-basis: calc(100% - 40px); }
  .sg-capa-row-actions { width: 100%; justify-content: flex-start; padding-left: 34px; }
}

/* ---------- Selfies: miniaturas que se amplían en una ventana emergente ---------- */
button.sg-selfie-item { padding: 0; width: 100%; cursor: zoom-in; font: inherit; text-align: left; }
button.sg-selfie-item:focus-visible, .sg-selfie-adm-foto:focus-visible { outline: 3px solid var(--color-accent, #147BE2); outline-offset: 2px; }
.sg-selfie-adm-foto { display: block; position: relative; width: 100%; padding: 0; border: 0; background: var(--color-neutral-200, #e8e6e4); cursor: zoom-in; }
.sg-selfie-adm-foto img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
/* Foto que no carga: en vez del ícono roto del navegador, un aviso legible */
.sg-selfie-item-fallo { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; padding: 12px;
  text-align: center; font-size: 13px; line-height: 1.3; color: var(--color-neutral-700, #5f5b57); background: var(--color-neutral-200, #e8e6e4); }
[data-error="1"] > .sg-selfie-item-fallo { display: flex; }
[data-error="1"] > img { visibility: hidden; }
[data-error="1"] { cursor: default; }
.sg-lb { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 56px 64px;
  background: rgba(10, 22, 44, .88); animation: sg-lb-in .16s ease-out; }
@keyframes sg-lb-in { from { opacity: 0; } to { opacity: 1; } }
.sg-lb-fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sg-lb-img { display: block; max-width: min(92vw, 1100px); max-height: calc(100vh - 170px); width: auto; height: auto; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45); background: #222; }
.sg-lb-error { margin: 0; padding: 10px 14px; border-radius: 8px; background: #fff; color: var(--sg-danger, #a5272c); font-size: 14px; }
.sg-lb-cap { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; text-align: center; font-size: 14px; line-height: 1.35; }
.sg-lb-cap strong { font-size: 16px; }
.sg-lb-cap span:empty { display: none; }
.sg-lb-pos { font-size: 12px; opacity: .75; }
.sg-lb-close, .sg-lb-nav { position: absolute; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; line-height: 1; font-family: inherit; }
.sg-lb-close:hover, .sg-lb-nav:hover { background: rgba(255,255,255,.28); }
.sg-lb-close:focus-visible, .sg-lb-nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sg-lb-close { top: 14px; right: 14px; width: 44px; height: 44px; font-size: 30px; }
.sg-lb-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 34px; }
.sg-lb-nav--prev { left: 10px; }
.sg-lb-nav--next { right: 10px; }
@media (max-width: 600px) {
  .sg-lb { padding: 60px 12px 24px; }
  .sg-lb-img { max-width: 100%; max-height: calc(100vh - 190px); }
  .sg-lb-nav { top: auto; bottom: 14px; transform: none; }
}

/* ---------- Reportes: filtros cruzados y tarjetas con botones de descarga ---------- */
.sg-rep-filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 12px; align-items: end;
  padding: 14px 16px; margin-bottom: 8px; background: #fff; border: 1px solid var(--color-neutral-300, #d6d4d2); border-radius: 12px; }
.sg-rep-filtros .sg-field { min-width: 0; }
.sg-rep-filtros .sg-in { width: 100%; }
.sg-rep-limpiar { justify-self: start; }
.sg-rep-ayuda { margin: 0 0 var(--space-4, 16px); }
.sg-rep-group { margin-bottom: var(--space-6, 24px); }
.sg-rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sg-rep-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: #fff; border: 1px solid var(--color-neutral-300, #d6d4d2);
  border-radius: 12px; border-top: 4px solid var(--color-accent, #147BE2); }
.sg-rep-card[data-on="1"] { box-shadow: 0 0 0 2px var(--color-accent, #147BE2); }
.sg-rep-card[data-vacio="1"] { border-top-color: var(--color-neutral-300, #d6d4d2); }
.sg-rep-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sg-rep-card-title { margin: 0; font-size: 16px; line-height: 1.25; color: var(--sg-navy, #132F5B); font-family: var(--font-heading); }
.sg-rep-count { flex: none; font-size: 12px; font-weight: 600; color: var(--color-accent-700, #0f4f97); background: var(--color-accent-100, #e8f2fd); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sg-rep-card[data-vacio="1"] .sg-rep-count { color: var(--color-neutral-700, #5f5b57); background: var(--color-neutral-200, #e8e6e4); }
.sg-rep-desc { margin: 0; flex: 1; font-size: 13px; line-height: 1.45; color: var(--color-neutral-700, #5f5b57); }
.sg-rep-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sg-rep-btn { border: 0; border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer; background: var(--c); }
.sg-rep-btn[data-f="xlsx"] { --c: #0B7A3B; }
.sg-rep-btn[data-f="pdf"] { --c: #C8283C; }
.sg-rep-btn[data-f="png"] { --c: #147BE2; }
.sg-rep-btn:hover:not(:disabled) { filter: brightness(1.1); }
.sg-rep-btn:disabled { background: var(--color-neutral-300, #d6d4d2); color: var(--color-neutral-700, #5f5b57); cursor: not-allowed; }
.sg-rep-btn:focus-visible, .sg-rep-ver:focus-visible { outline: 3px solid var(--sg-navy, #132F5B); outline-offset: 2px; }
.sg-rep-ver { margin-left: auto; border: 0; background: none; padding: 6px 4px; font: inherit; font-size: 13px; color: var(--color-accent-700, #0f4f97); text-decoration: underline; cursor: pointer; }
.sg-rep-prev { margin: 0 0 var(--space-6, 24px); padding: 14px 16px; background: #fff; border: 2px solid var(--color-accent, #147BE2); border-radius: 12px; }
.sg-rep-prev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.sg-rep-prev-sub { margin: 0; font-size: 13px; }
.sg-rep-t td, .sg-rep-t th { white-space: nowrap; }
@media (max-width: 600px) {
  .sg-rep-filtros { grid-template-columns: 1fr 1fr; padding: 12px; }
  .sg-rep-filtros .sg-field:first-child { grid-column: 1 / -1; }
  .sg-rep-ver { margin-left: 0; }
}

/* ---------- Equipo territorial: parroquias rurales y selector del panel lateral ---------- */
.sg-adm-rural-title { margin-top: 28px; }
.sg-adm-card-v[data-pend="1"] { color: var(--color-neutral-600, #8a8580); font-weight: 400; font-style: italic; }
.sg-adm-modo { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 10px; background: var(--color-neutral-200, #e8e6e4); }
.sg-adm-modo-b { flex: 1; border: 0; border-radius: 8px; padding: 7px 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--color-neutral-800, #3d3a37); cursor: pointer; }
.sg-adm-modo-b[aria-selected="true"] { background: #fff; color: var(--sg-navy, #132F5B); box-shadow: 0 1px 4px rgba(19,47,91,.15); }
.sg-adm-modo-b:focus-visible { outline: 2px solid var(--color-accent, #147BE2); outline-offset: 1px; }
.sg-adm-actual { margin: 4px 0 0; font-size: 13px; }

/* Agenda: calendario mensual con filtro por tipo (colores por tipo: data-tipo 0–9) */
.sg-ag [data-tipo="0"] { --c: #223260; } .sg-ag [data-tipo="1"] { --c: #c0392b; } .sg-ag [data-tipo="2"] { --c: #2e8b57; }
.sg-ag [data-tipo="3"] { --c: #8a5a00; } .sg-ag [data-tipo="4"] { --c: #6a3d9a; } .sg-ag [data-tipo="5"] { --c: #0f7f9b; }
.sg-ag [data-tipo="6"] { --c: #b5006c; } .sg-ag [data-tipo="7"] { --c: #00867d; } .sg-ag [data-tipo="8"] { --c: #555555; }
.sg-ag [data-tipo="9"] { --c: #a86b00; }
.sg-ag { display: flex; flex-direction: column; gap: 14px; }
.sg-ag-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.sg-ag-top .sg-h2 { margin: 0; }
.sg-ag-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sg-ag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #c9c7c5; border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; }
.sg-ag-chip b { font-weight: 700; opacity: .7; }
.sg-ag-chip[aria-pressed="true"] { background: #223260; border-color: #223260; color: #fff; }
.sg-ag-chip[aria-pressed="true"] b, .sg-ag-chip[aria-pressed="true"] .sg-ag-punto { opacity: 1; }
.sg-ag-chip[aria-pressed="true"] .sg-ag-punto { border-color: #fff; }
.sg-ag-punto { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.sg-ag-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.sg-ag-calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sg-ag-wd { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b6866; padding: 4px 6px; }
.sg-ag-dia { min-height: 96px; background: #fff; border: 1px solid #e3e1df; border-radius: 6px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.sg-ag-dia:hover, .sg-ag-dia:focus-visible { border-color: #223260; outline: none; }
.sg-ag-dia[data-out="1"] { background: #f5f4f3; color: #9b9797; }
.sg-ag-dia[data-hoy="1"] .sg-ag-num { background: #223260; color: #fff; border-radius: 999px; padding: 0 7px; }
.sg-ag-dia[data-sel="1"] { border: 2px solid #E83F44; }
.sg-ag-num { font-weight: 700; font-size: 13px; align-self: flex-start; }
.sg-ag-pill { display: block; font-size: 11px; line-height: 1.25; color: #fff; background: var(--c); border-radius: 4px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-ag-mas { font-size: 11px; color: #6b6866; }
.sg-ag-panel { background: #fff; border: 1px solid #e3e1df; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 720px; overflow-y: auto; position: sticky; top: 8px; }
.sg-ag-item { display: flex; gap: 10px; align-items: stretch; text-align: left; background: #fafaf9; border: 1px solid #e3e1df; border-radius: 6px; padding: 8px; cursor: pointer; width: 100%; }
.sg-ag-item:hover { border-color: #223260; }
.sg-ag-tira { width: 4px; border-radius: 2px; background: var(--c); flex: none; }
.sg-ag-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg-ag-item-titulo { font-weight: 700; font-size: 13px; }
.sg-ag-item-pend { background: #fffdf7; }
.sg-ag-pend { border-top: 1px dashed #c9c7c5; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) {
  .sg-ag-cuerpo { grid-template-columns: 1fr; }
  .sg-ag-panel { position: static; max-height: none; }
  .sg-ag-dia { min-height: 60px; }
  .sg-ag-pill { font-size: 10px; }
}
@media (max-width: 560px) {
  .sg-ag-pill { display: none; }
  .sg-ag-dia { min-height: 44px; }
}

/* ---------- Candidatos/as en Equipo territorial ---------- */
.sg-cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.sg-cand-card { padding: 12px 14px; background: #fff; border: 1px solid var(--color-neutral-300, #d6d4d2); border-radius: 12px; border-top: 4px solid var(--color-accent, #147BE2); }
.sg-cand-card[data-tipo="concejal_rural"] { border-top-color: #0B9A47; }
.sg-cand-card[data-tipo="vocal_junta"] { border-top-color: var(--sg-navy, #132F5B); }
.sg-cand-tit { margin: 0 0 8px; font-size: 15px; line-height: 1.3; color: var(--sg-navy, #132F5B); font-family: var(--font-heading); }
.sg-cand-lista { list-style: none; margin: 0; padding: 0; }
.sg-cand-fila { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--color-neutral-200, #e8e6e4); }
.sg-cand-fila:first-child { border-top: 0; }
.sg-cand-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--color-accent, #147BE2); }
.sg-cand-card[data-tipo="concejal_rural"] .sg-cand-n { background: #0B9A47; }
.sg-cand-card[data-tipo="vocal_junta"] .sg-cand-n { background: var(--sg-navy, #132F5B); }
.sg-cand-pers { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sg-cand-k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700, #5f5b57); }
.sg-cand-nom { padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; color: var(--color-text, #201e1d); cursor: pointer; }
.sg-cand-pers--s .sg-cand-nom { font-weight: 500; }
.sg-cand-nom:hover:not(:disabled) { color: var(--color-accent-700, #0f4f97); text-decoration: underline; }
.sg-cand-nom:disabled { cursor: default; }
.sg-cand-nom[data-pend="1"] { color: var(--sg-danger, #a5272c); font-style: italic; font-weight: 500; }
.sg-cand-c { font-size: 12px; color: var(--color-neutral-700, #5f5b57); overflow-wrap: anywhere; }
.sg-cand-c:empty { display: none; }
.sg-cand-obs { font-size: 11.5px; line-height: 1.35; color: #8a5a00; background: #fff6e0; border-radius: 4px; padding: 2px 6px; margin-top: 2px; }
@media (max-width: 600px) {
  .sg-cand-grid { grid-template-columns: minmax(0, 1fr); }
  .sg-cand-fila { grid-template-columns: 24px minmax(0, 1fr); }
  .sg-cand-pers--s { grid-column: 2; }
}

/* ---------- Tablero de campaña (jefes de campaña y directores/as) ----------
   Reutiliza la cifra grande y las tarjetas del Resumen (.sg-res-*); aquí van el selector de período, las
   tarjetas de responsables por área (color del semáforo por data-tl), las barras semanales y el editor de áreas. */
.sg-camp-periodo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--space-3); }
.sg-camp-chip { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid #c9c7c5; border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; font-family: var(--font-body); color: var(--color-text); }
.sg-camp-chip:hover { border-color: var(--color-accent-300, #9cc8f3); }
.sg-camp-chip[aria-pressed="true"] { background: var(--sg-navy); border-color: var(--sg-navy); color: #fff; }
.sg-camp-chip:focus-visible { outline: 2px solid var(--jv-azul); outline-offset: 2px; }
.sg-camp-rango { font-size: 13px; margin-left: 4px; }
.sg-camp-sec { margin-bottom: var(--space-6); }
.sg-camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sg-camp-head .sg-help { margin-top: 2px; }
.sg-camp-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-3); margin-top: 8px; }
.sg-camp-area { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--color-neutral-300); border-left: 5px solid var(--c, var(--tl-gris)); border-radius: 4px; }
.sg-camp-area-tit { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--jv-azul); }
.sg-camp-area-resp { margin: 0; font-size: 17px; font-weight: 700; font-family: var(--font-heading); color: var(--sg-navy); line-height: 1.25; }
.sg-camp-area-resp[data-pend="1"] { font-weight: 400; font-style: italic; color: #b3261e; font-size: 15px; }
.sg-camp-area-c { margin: 0; font-size: 12.5px; color: var(--color-neutral-700); line-height: 1.4; }
.sg-camp-area-desc { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--color-text); }
.sg-camp-area-stats { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 8px; font-size: 12.5px; color: var(--color-neutral-700); }
.sg-camp-area-stats .sg-bartrack { flex: none; width: 100%; height: 8px; }
.sg-camp-sem .sg-barrow-label { width: 128px; }
.sg-camp-sem[data-actual="1"] { font-weight: 700; }
.sg-camp-sem[data-actual="1"] .sg-bartrack { outline: 2px solid var(--jv-celeste-2); outline-offset: 1px; }
.sg-camp-bar-p { fill: #a9cdf3; }
.sg-camp-bar-d { fill: var(--sg-navy); }
.sg-camp-t th { white-space: nowrap; }
.sg-camp-pct { display: inline-block; min-width: 54px; padding: 1px 8px; border-radius: 999px; text-align: center; font-weight: 700; font-size: 12.5px; background: var(--c, #e6e4e2); color: var(--fg, var(--sg-ink)); }
.sg-camp-date-venc { background: #fde7ea; color: #b3261e; }
.sg-camp-tipos-k { margin-bottom: 4px; }
.sg-camp-tipos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
@media (max-width: 600px) {
  .sg-camp-areas { grid-template-columns: minmax(0, 1fr); }
  .sg-camp-sem .sg-barrow-label { width: 96px; font-size: 12px; }
  .sg-camp-sem .sg-barrow-value { width: 70px; }
}
@media print {
  .sg-camp-area, .sg-camp-pct, .sg-camp-bar-p, .sg-camp-bar-d, .sg-camp-date-venc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sg-camp-areas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Personas en tarjetas (Administración → Personas): acciones dentro de cada tarjeta y marca de duplicados */
.sg-tarjeta--persona { cursor: default; }
.sg-tarjeta-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sg-b2--danger { color: var(--sg-danger, #a5272c); border-color: var(--sg-danger, #a5272c); }
.sg-b2--danger:hover { background: #fdeeef; border-color: var(--sg-danger, #a5272c); }
.sg-b2--keep { background: var(--color-accent-100); }
.sg-tarjeta--persona[data-dup="1"] { border-color: var(--sg-danger, #a5272c); }

/* ---------- Línea gráfica de campaña «El Johnvi»: formas redondeadas y figuras en lugar de listas ---------- */
:root { --color-bg: #fff9f2; --jv-radio: 22px; }
body { background: var(--color-bg); }
.sg-tarjeta, .sg-figura-bloque, .sg-kpi-burbuja { border-radius: var(--jv-radio); }
.sg-tarjeta { box-shadow: 0 2px 0 rgba(19, 47, 91, .06); }
.sg-b, .sg-b2 { border-radius: 999px; padding-left: 18px; padding-right: 18px; }
.sg-in { border-radius: 14px; }
:focus-visible { outline: 3px solid var(--jv-naranja-2); outline-offset: 2px; }

.sg-figura-bloque { background: #fff; border: 1px solid #f0e6da; padding: 18px 20px 20px; margin: 0 0 18px; box-shadow: 0 6px 18px rgba(19, 47, 91, .06); }
.sg-tres { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 18px; }
.sg-tres > .sg-figura-bloque { margin-bottom: 0; }

/* Cifras clave como burbujas */
.sg-kpi-burbujas { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 0 0 22px; }
.sg-kpi-burbuja { width: 150px; height: 150px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px; color: #fff; background: var(--jv-azul); }
.sg-kpi-burbuja:nth-child(4n+2) { background: var(--jv-rosa); }
.sg-kpi-burbuja:nth-child(4n+3) { background: var(--jv-verde); }
.sg-kpi-burbuja:nth-child(4n+4) { background: var(--jv-morado); }
.sg-kpi-burbuja .sg-kpi-num { color: #fff; font-size: 26px; }
.sg-kpi-burbuja .sg-kpi-label { color: #fff; font-size: 12px; }

/* Avance por plataforma: anillos */
.sg-anillos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px 12px; margin-top: 12px; }
.sg-anillo { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.sg-anillo-svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.sg-anillo-base { fill: none; stroke: #efe9e1; stroke-width: 3.4; }
.sg-anillo-trazo { fill: none; stroke: var(--c, var(--jv-azul)); stroke-width: 3.4; stroke-linecap: round; }
.sg-anillo { position: relative; }
.sg-anillo-pct { position: absolute; top: 30px; left: 0; right: 0; font-family: var(--font-heading); font-weight: 700; font-size: 18px; color: var(--sg-ink); }
.sg-anillo-nom { margin-top: 4px; font-weight: 700; font-size: 13px; color: var(--sg-navy); }
.sg-anillo-det { font-size: 11.5px; color: var(--color-neutral-700); line-height: 1.3; }

/* Actividades por estado: figuras geométricas */
.sg-figuras { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 14px; margin-top: 10px; }
.sg-figura { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 90px; }
.sg-figura-forma { display: block; width: 58px; height: 58px; background: var(--jv-morado); }
.sg-figura[data-fig="circulo"] .sg-figura-forma { border-radius: 50%; background: var(--jv-verde); }
.sg-figura[data-fig="cuadrado"] .sg-figura-forma { border-radius: 16px; background: var(--jv-azul); }
.sg-figura[data-fig="triangulo"] .sg-figura-forma { background: var(--jv-rosa); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sg-figura[data-fig="hexagono"] .sg-figura-forma { background: var(--jv-amarillo-2); clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
.sg-figura[data-fig="rombo"] .sg-figura-forma { background: var(--jv-morado); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.sg-figura-num { font-family: var(--font-heading); font-weight: 700; font-size: 22px; color: var(--sg-navy); }
.sg-figura-txt { font-size: 12.5px; color: var(--color-neutral-700); }

/* Direcciones: burbujas proporcionales al número de actividades */
.sg-burbujas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 8px; }
.sg-burbuja { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: 50%; background: #eaf6fd; color: var(--sg-navy); border: 3px solid var(--jv-celeste-2); padding: 6px; width: 96px; height: 96px; }
.sg-burbuja:nth-child(3n+2) { border-color: var(--jv-azul); }
.sg-burbuja:nth-child(3n) { border-color: var(--jv-petroleo); }
.sg-burbuja[data-size="m"] { width: 118px; height: 118px; }
.sg-burbuja[data-size="l"] { width: 142px; height: 142px; }
.sg-burbuja[data-size="xl"] { width: 168px; height: 168px; }
.sg-burbuja-num { font-family: var(--font-heading); font-weight: 700; font-size: 20px; line-height: 1; }
.sg-burbuja-nom { font-size: 12px; line-height: 1.2; max-width: 92%; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sg-burbuja-det { font-size: 11px; color: var(--color-neutral-700); }

/* Próximos 30 días: tarjetas redondeadas */
.sg-figura-bloque .sg-tarjeta { border-radius: 18px; }

/* Señalar en el mapa la ubicación de un parque: aviso fijo sobre el mapa, con la coordenada en curso */
.sg-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-4);
  margin: 0 0 var(--space-3); padding: 12px 16px; border-radius: var(--jv-radio, 0);
  background: var(--color-accent-100); border-left: 5px solid var(--jv-verde); }
.sg-pick-t { margin: 0; font-family: var(--font-heading); font-size: 16px; color: var(--sg-navy); }
.sg-pick-s { margin: 0; flex: 1 1 240px; font-size: 13px; line-height: 1.4; color: var(--sg-ink); }
.sg-pick .sg-actions { margin: 0; }
