/* ============================================================
   GP DESARROLLOS — Dashboard de Portafolio
   styles.css — v1.0
   Fuente: dashboard_v16.html
   ============================================================ */


/* ── RESET Y BASE ─────────────────────────────────────────── */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f0ee;
  color: #1a1a1a;
}

.hidden {
  display: none !important;
}


/* ── HEADER ───────────────────────────────────────────────── */

.header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  flex-wrap: wrap;
  gap: 16px;
}

.logo img {
  height: 34px;
  display: block;
}

/* Header de EcoS centrado en la barra, independiente del ancho de los
   elementos de los costados (logo GP a la izq., usuario/logout a la der.) */
.header-ecos-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.header-ecos-brand img {
  height: 26px;
  display: block;
}

.corte {
  font-size: 12px;
  color: #999;
}


/* ── TABS PRINCIPALES (N1) ────────────────────────────────── */

.tabs {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 2rem;
  display: flex;
}

.tab {
  font-size: 13px;
  padding: 13px 22px;
  cursor: pointer;
  color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}

.tab:hover,
.tab.active {
  color: rgb(34, 47, 92);
}

.tab.active {
  border-bottom-color: rgb(34, 47, 92);
  font-weight: 600;
}


/* ── CONTENEDOR PRINCIPAL ─────────────────────────────────── */

.main {
  padding: 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}


/* ── N1 · MÉTRICAS DEL PORTAFOLIO ─────────────────────────── */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.metric {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border: 1px solid #e0e0e0;
}

.metric-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: rgb(34, 47, 92);
}

.metric-sub {
  font-size: 11px;
  color: #bbb;
  margin-top: 3px;
}


/* ── N1 · SECTION CARD (contenedor genérico de sección) ───── */

.section-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 1.25rem;
}


/* ── N1 · TIMELINE DE HITOS (portafolio) ──────────────────── */

.tl-outer {
  overflow-x: auto;
  padding-bottom: 4px;
}

.tl-container {
  min-width: 580px;
}

.tl-months-row {
  display: flex;
  border-bottom: 2px solid #e8e8e8;
  margin-left: 155px;
}

.tl-month {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #bbb;
  padding: 3px 0 7px;
  font-weight: 500;
  position: relative;
}

.tl-month::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 1px;
  height: 5px;
  background: #e0e0e0;
}

.tl-month.today {
  color: rgb(238, 103, 35);
  font-weight: 700;
}

.tl-month.today::before {
  background: rgb(238, 103, 35);
  height: 8px;
  width: 2px;
}

.tl-rows {
  padding: 10px 0 4px;
}

.tl-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  min-height: 32px;
}

.tl-row-label {
  width: 155px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: rgb(34, 47, 92);
  padding-right: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.tl-row-label:hover {
  color: rgb(238, 103, 35);
}

.tl-row-track {
  flex: 1;
  position: relative;
  height: 32px;
}

.tl-prog-bar {
  position: absolute;
  height: 6px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 3px;
  opacity: .18;
  background: rgb(34, 47, 92);
}

.tl-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #fff;
  z-index: 2;
  cursor: pointer;
  transition: transform .15s;
}

.tl-dot:hover {
  transform: translate(-50%, -50%) scale(1.3);
}

.tl-dot-label {
  position: absolute;
  top: calc(50% + 10px);
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 2;
}

.tl-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgb(238, 103, 35);
  opacity: .5;
  z-index: 1;
  pointer-events: none;
}

.tl-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.tl-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #999;
}

.tl-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tl-mobile-list {
  display: none;
}


/* ── N1 · CARDS DE PROYECTOS ──────────────────────────────── */

.cards-title {
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 1rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.proj-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
}

.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(34, 47, 92, .13);
}

.card-img {
  position: relative;
  height: 120px;
  overflow: hidden;
}

.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      to top,
      rgba(18, 28, 55, .34) 0%,
      rgba(18, 28, 55, .16) 34%,
      rgba(18, 28, 55, 0) 72%
    );
  pointer-events: none;
}


.card-semaforo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .8);
  z-index: 3;
}

.card-donuts {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.donut-lbl {
  font-size: 9px;
  color: rgba(255, 255, 255, .9);
  font-weight: 500;
}

.card-info {
  padding: 12px 14px 14px;
}

.card-tipo {
  font-size: 10px;
  color: rgb(238, 103, 35);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}

.card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: rgb(34, 47, 92);
}

.card-meta {
  font-size: 11px;
  color: #999;
}


/* ── N2 · NAVEGACIÓN Y TABS DE PROYECTO ──────────────────── */

.lvl2-nav {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid transparent;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 500;
  padding-top: .75rem;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.lvl2-nav-stuck {
  background: rgba(248, 249, 252, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: #e0e0e0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}

.lvl2-export-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: rgb(34, 47, 92);
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  padding: 7px 14px 7px 12px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}

.lvl2-export-btn svg { flex-shrink: 0; }

.lvl2-export-btn:hover {
  border-color: rgb(238, 103, 35);
  color: rgb(238, 103, 35);
}

.lvl2-export-btn:disabled { opacity: .55; cursor: default; }

.lvl2-back {
  font-size: 12px;
  color: #999;
  cursor: pointer;
  padding: 8px 14px 12px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  transition: color .15s;
  flex-shrink: 0;
}

.lvl2-back:hover {
  color: rgb(238, 103, 35);
}

.lvl2-tab {
  font-size: 12px;
  padding: 10px 14px 12px;
  cursor: pointer;
  color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s;
}

.lvl2-tab:hover {
  color: rgb(34, 47, 92);
}

.lvl2-tab.active {
  color: rgb(34, 47, 92);
  border-bottom-color: rgb(34, 47, 92);
  font-weight: 600;
}


/* ── N2 · HERO + KPIs (fila superior) ────────────────────── */

.hero-kpis-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

.hero-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  height: 200px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10, 20, 60, .72) 40%, rgba(10, 20, 60, .15));
  pointer-events: none;
}

.hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 1.25rem 1.5rem;
  pointer-events: none;
}

.hero-tipo {
  font-size: 11px;
  color: rgb(238, 103, 35);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.hero-name {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

/* Para proyectos en Cierre a Property, este wrap también aloja el pill
   "Cierre a Property" (ver .hero-cp-pill abajo) a la izquierda de
   "Info general", con un separador entre los dos. */
.hero-hint-wrap {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Pill "Cierre a Property" (% avance + días en cierre) dentro del hero —
   mismo estilo traslúcido azul marino que tenía "Info general" antes de
   volverse naranja. pointer-events:auto es necesario porque vive dentro de
   .hero-text (pointer-events:none a propósito, para que los clics del resto
   del hero abran "Info general"); sin este override nunca recibiría el clic
   para abrir el modal de Cierre a Property. */
.hero-cp-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 20, 60, .55);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 10px;
  padding: 7px 14px;
  pointer-events: auto;
}

.hero-cp-pill.cp-clickable {
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.hero-cp-pill.cp-clickable:hover {
  background: rgba(10, 20, 60, .75);
  border-color: rgba(255, 255, 255, .5);
}

.hero-cp-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.hero-cp-pct {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.hero-cp-bar-track {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, .25);
  border-radius: 3px;
  overflow: hidden;
}
.hero-cp-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: rgb(238, 103, 35);
}

.hero-cp-dias {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* Separador vertical delgado — se usa tanto dentro del pill de Cierre a
   Property como entre ese pill y el botón de Info general. */
.hero-divider-v {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, .3);
  flex-shrink: 0;
}

.hero-hint {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  /* Naranja sólido desde el inicio (antes era translúcido y solo se veía
     naranja al pasar el mouse) — Gabz dijo que la gente no lo estaba
     notando, así que ya no depende del hover para destacar. */
  background: rgb(238, 103, 35);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(238, 103, 35, .45);
  transition: background .2s, border-color .2s;
}

.hero-wrap:hover .hero-hint {
  background: rgb(200, 82, 20);
}

.hero-chev {
  font-size: 15px;
  transition: transform .25s;
  display: inline-block;
  animation: hero-chev-bounce 1.8s ease-in-out infinite;
}

.hero-chev.open {
  transform: rotate(180deg);
  animation: none;
}

@keyframes hero-chev-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* Hint "Ver Curva S" dentro del header azul de Timeline del proyecto —
   antes era texto chiquito y apagado (opacity .65, <small>), poco notorio. */
.tl-curva-hint {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  background: rgb(238, 103, 35);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tl-curva-arrow {
  display: inline-block;
  animation: hero-chev-bounce 1.8s ease-in-out infinite;
}

.hero-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 10px 10px;
  margin-top: -10px;
  padding-top: 10px;
}

.hero-expand.open {
  max-height: 600px;
}

/* Columna derecha del hero (junto al KPI grid): apila las tarjetas de KPI y,
   debajo, el panel de documentos — que aprovecha el espacio que antes
   quedaba vacío bajo esas tarjetas cuando Info general estaba abierto.
   OJO: sin "gap" aquí a propósito — el gap de flexbox se aplica SIEMPRE
   entre hijos, incluso con uno colapsado a 0 de alto, lo que sumaba unos
   px extra a esta columna y la desalineaba del hero (que sí mide 200px
   fijos). El espacio hacia "Documentos" se controla mejor abajo, con
   margin-top SOLO en .hero-docs-panel.open (cuando en verdad ocupa lugar). */
.hero-kpis-right {
  display: flex;
  flex-direction: column;
}

.hero-docs-panel {
  max-height: 0;
  min-height: 0; /* dentro de .hero-kpis-right (flex column) — sin esto algunos
                    navegadores no lo dejan colapsar a 0 por el min-height:auto
                    implícito de los flex items */
  margin-top: 0;
  overflow: hidden;
  transition: max-height .4s ease, margin-top .4s ease;
}

.hero-docs-panel.open {
  max-height: 600px;
  margin-top: 10px; /* ← este número controla qué tan abajo aparece "Documentos" respecto a los KPIs, ajústalo aquí (no en el gap de arriba) */
  overflow-y: auto;
}


/* ── N2 · KPI CARDS (2x2) ─────────────────────────────────── */

.kpis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  height: 200px;
  overflow: hidden; /* candado real a 200px — sin esto, si el contenido de
    alguna tarjeta no cabe justo en su fila, el min-height:auto implícito de
    los grid items puede estirar la grilla más allá de los 200px y desalinea
    el bloque de KPIs contra el hero (que sí es rígido a 200px). */
}

/* Ya no hace falta tratar la grilla de KPIs distinto para Cierre a
   Property: el dato de Cierre a Property se movió a un pill dentro del
   hero (.hero-cp-pill), así que la grilla se queda en su 2x2 fijo normal
   para todos los proyectos. */

.kpi-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  padding: .875rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0; /* evita que el contenido interno empuje la tarjeta (y con
    ella la fila del grid) más alto de lo que le toca */
  overflow: hidden;
}

/* nowrap + letter-spacing más chico: a 145px de ancho de tarjeta,
   "AVANCE FINANCIERO" y "ENTREGA SUSTANCIAL" alcanzaban a envolver a una
   segunda línea con el tamaño/letter-spacing anterior, lo que empujaba el
   resto del contenido de la tarjeta hacia abajo y lo recortaba (la barra de
   Avance financiero, el badge de Entrega sustancial). */
.kpi-label {
  font-size: 9px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: 5px;
  white-space: nowrap;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: rgb(34, 47, 92);
}

.kpi-sub {
  font-size: 10px;
  color: #bbb;
  margin-top: 2px;
}

.kpi-bar {
  margin-top: 6px;
  height: 5px;
  background: #f0f0ee;
  border-radius: 3px;
  overflow: hidden;
}

.kpi-bar-fill {
  height: 100%;
  border-radius: 3px;
}


/* ── N2 · INFO GENERAL (grid expandible bajo el hero) ─────── */

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 1.25rem;
}

.info-item {
  background: #f8f8f8;
  border-radius: 8px;
  padding: .75rem 1rem;
}

.info-label {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: rgb(34, 47, 92);
}

/* Info general (N3) agrupada en 3 columnas temáticas (general / dinero /
   proceso) en vez de una sola grilla plana — cada columna es su propio stack
   vertical, reutiliza .info-item/.info-label/.info-value para las tarjetas. */
.info-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 1.25rem;
  align-items: start;
}

.info-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-col-title {
  font-size: 10.5px;
  font-weight: 700;
  color: rgb(34, 47, 92);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding-bottom: 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid #ececec;
}


/* ── N2 · SECCIONES CON HEADER AZUL EXPANDIBLE ────────────── */

.lvl2-section {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  margin-bottom: 1rem;
  overflow: hidden;
}

.lvl2-section-body {
  padding: 1.25rem;
  cursor: pointer;
}

.lvl2-section-body:hover {
  background: #fafafa;
}

.sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgb(34, 47, 92);
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
}

.sec-hdr-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sec-hdr-right {
  font-size: 11px;
  color: rgba(255, 255, 255, .65);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sec-chev {
  font-size: 14px;
  color: rgba(255, 255, 255, .7);
  transition: transform .25s;
}

.sec-chev.open {
  transform: rotate(180deg);
}

.expand-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s ease;
}

.expand-drawer.open {
  max-height: 3000px;
}

.expand-inner {
  padding: 1.25rem;
  border-top: 1px solid #f0f0f0;
}

/* Variante full-width para presupuesto */
.fullwidth-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s ease;
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}

.fullwidth-expand.open {
  max-height: 3000px;
}

.fullwidth-inner {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 10px 10px;
}


/* ── N2 · DOS COLUMNAS (timeline + riesgos) ───────────────── */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}


/* ── N2 · TIMELINE DE HITOS DEL PROYECTO ─────────────────── */

.ptl-wrap {
  padding-top: 1.5rem;
  padding-left: 60px;
  padding-right: 60px;
  padding-bottom: 2rem;
}

.ptl-track {
  position: relative;
  height: 16px;
}

.ptl-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  transform: translateY(-50%);
}

.ptl-fill {
  height: 100%;
  background: rgb(34, 47, 92);
  border-radius: 2px;
}

.ptl-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%,-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  z-index: 2;
}

.ptl-label {
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  width: 110px;
  text-align: center;
}

.ptl-date {
  position: absolute;
  top: 26px;
  transform: translateX(-50%);
  font-size: 9px;
  color: #999;
  white-space: nowrap;
  width: 110px;
  text-align: center;
}

/* ── N2 · TIMELINE — FASES DE OBRA (puntos discretos + barra al hover) ────
   Fechas clave editables por admin (Estructura, Firme, Muros, Cubierta...).
   El punto va sobre la misma línea de los hitos comerciales, pero discreto
   (gris/blanco) para no competir con ellos. Nombre y fecha siempre visibles,
   intercalando abajo/arriba según el orden de inicio de cada fase (sin
   niveles adicionales). La barra de duración solo aparece al pasar el
   cursor o dar clic sobre el punto — ver el wiring en buildLvl2(). */
.ptl-fase-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%,-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #c3c9d6;
  z-index: 3;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.ptl-fase-dot:hover {
  border-color: rgb(34, 47, 92);
  box-shadow: 0 0 0 3px rgba(34, 47, 92, .12);
}

.ptl-fase-dot.is-active {
  background: rgb(34, 47, 92);
  border-color: rgb(34, 47, 92);
  box-shadow: 0 0 0 4px rgba(34, 47, 92, .16);
  transform: translate(-50%,-50%) scale(1.25);
}

.ptl-fase-label {
  position: absolute;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.ptl-fase-label .nm {
  font-size: 8.5px;
  font-weight: 400;
  color: #8f96a8;
  white-space: nowrap;
  transition: color .15s ease, font-weight .15s ease;
}

.ptl-fase-label .dt {
  font-size: 7.5px;
  color: #b7bcc8;
  margin-top: 1px;
  white-space: nowrap;
}

.ptl-fase-label.is-active {
  background: rgb(34, 47, 92);
  border-radius: 7px;
  padding: 5px 9px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 6;
}

.ptl-fase-label.is-active .nm {
  color: #fff;
  font-weight: 600;
  font-size: 10.5px;
}

.ptl-fase-label.is-active .dt {
  color: rgba(255,255,255,.75);
  font-size: 9px;
  margin-top: 2px;
}

.ptl-fase-label.side-bottom.is-active {
  transform: translate(-50%, 8px);
}

.ptl-fase-label.side-top.is-active {
  transform: translate(-50%, -8px);
}

.ptl-fase-label.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}

.ptl-fase-label.side-bottom.is-active::after {
  top: -8px;
  border-bottom-color: rgb(34, 47, 92);
}

.ptl-fase-label.side-top.is-active::after {
  bottom: -8px;
  border-top-color: rgb(34, 47, 92);
}

.ptl-fase-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 8px;
  border-radius: 5px;
  background: rgba(34, 47, 92, .16);
  border: 1px solid rgba(34, 47, 92, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 1;
}

.ptl-fase-bar.show {
  opacity: 1;
  background: rgba(34, 47, 92, .22);
  border-color: rgb(34, 47, 92);
}

.tl-editar-fases-btn {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  margin-right: 8px;
  font-family: inherit;
}

.tl-editar-fases-btn:hover {
  background: rgba(255, 255, 255, .24);
}


/* ── N2 · CURVA S ─────────────────────────────────────────── */

.info-doc-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: .75rem 1.25rem;
  border-top: 1px solid #f0f0f0;
}

/* Variante vertical — panel de documentos en la columna derecha del hero
   (angosta), un botón por fila en vez de pills envueltas en fila. */
.info-doc-pills.vertical {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  padding: 0;
  border-top: none;
}

.info-doc-pills.vertical .doc-pill {
  border-radius: 8px;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}

.doc-pill-active {
  background: rgb(34, 47, 92);
  color: #fff;
  border: 1.5px solid rgb(34, 47, 92);
  cursor: pointer;
}

.doc-pill-active:hover {
  background: rgb(238, 103, 35);
  border-color: rgb(238, 103, 35);
}

.doc-pill-disabled {
  background: #f5f5f5;
  color: #bbb;
  border: 1.5px solid #e8e8e8;
  cursor: not-allowed;
}

/* ── VISOR DE DOCUMENTOS (modal del hero N2) ─────────────────────────── */
#doc-viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}

.doc-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 40, .55);
}

.doc-viewer-box {
  position: relative;
  width: min(900px, 92vw);
  height: min(85vh, 900px);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.doc-viewer-title {
  font-size: 13px;
  font-weight: 700;
  color: rgb(34, 47, 92);
}

.doc-viewer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-viewer-download-btn {
  font-size: 11px;
  font-weight: 600;
  color: rgb(34, 47, 92);
  border: 1.5px solid rgb(34, 47, 92);
  border-radius: 20px;
  padding: 5px 12px;
  text-decoration: none;
  transition: all .15s;
}

.doc-viewer-download-btn:hover {
  background: rgb(34, 47, 92);
  color: #fff;
}

.doc-viewer-close {
  background: none;
  border: none;
  font-size: 15px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.doc-viewer-close:hover { color: rgb(238, 103, 35); }

#doc-viewer-frame {
  flex: 1;
  border: none;
  width: 100%;
}

@media (max-width: 640px) {
  .doc-viewer-box { width: 96vw; height: 90vh; border-radius: 8px; }
}

.cs-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: .75rem;
}

.cs-kpi-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: .75rem 1rem;
}

.cs-kpi-card-accent {
  border-color: #fde8db;
  background: #fff9f6;
}

.cs-kpi-label {
  font-size: 10px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.cs-kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.cs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: .75rem;
}

.cs-pills-toggle {
  display: none;
}

.cs-pill {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: #777;
  cursor: pointer;
  transition: all .15s;
}

.cs-pill:hover {
  border-color: rgb(238, 103, 35);
  color: rgb(238, 103, 35);
}

.cs-pill-active {
  background: rgb(34, 47, 92);
  border-color: rgb(34, 47, 92);
  color: #fff !important;
}

.curva-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.curva-stat-label {
  font-size: 10px;
  color: #999;
}

.curva-stat-value {
  font-size: 18px;
  font-weight: 700;
}

.curva-svg {
  width: 100%;
  min-width: 600px;
}

.curva-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 8px;
}

.curva-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #555;
}

.curva-legend-line {
  width: 24px;
  height: 3px;
  border-radius: 2px;
}


/* ── N2 · PRESUPUESTO — tabla resumen ─────────────────────── */

.presup-sm {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.presup-sm th {
  font-size: 10px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  text-align: right;
  border-bottom: 1px solid #e0e0e0;
}

.presup-sm th:first-child {
  text-align: left;
}

.presup-sm td {
  padding: 5px 8px;
  border-bottom: 1px solid #f5f5f5;
  color: #444;
  text-align: right;
}

.presup-sm td:first-child {
  text-align: left;
  color: #1a1a1a;
}

.presup-sm tr.sm-bold td {
  font-weight: 600;
  color: rgb(34, 47, 92);
}

.presup-sm tr.sm-total td {
  font-weight: 700;
  color: #fff;
  background: rgb(34, 47, 92);
}


/* ── N2 · PRESUPUESTO — tabla completa con hover ──────────── */

.presup-full-wrap {
  overflow-x: auto;
}

.presup-full {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  min-width: 860px;
  position: relative;
}

.presup-full th {
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 8px;
  text-align: right;
  background: rgb(34, 47, 92);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 3;
}

.presup-full th:first-child {
  text-align: left;
}

.presup-full .grp {
  background: rgb(24, 37, 72);
  font-size: 9px;
  text-align: center;
  padding: 3px 8px;
}

.presup-full td {
  padding: 6px 8px;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
  text-align: right;
  font-size: 11px;
  transition: background .1s;
}

.presup-full td:first-child {
  text-align: left;
  color: #1a1a1a;
}

.presup-full tr.pf-sub td {
  font-weight: 600;
  color: rgb(34, 47, 92);
  background: #f0f3ff;
}

.presup-full tr.pf-total td {
  font-weight: 700;
  color: #fff;
  background: rgb(238, 103, 35);
}

/* Clases de highlight añadidas por JS al hacer hover */
.presup-full td.delta-up   { background: rgba(34, 47, 92, .07); color: rgb(34, 47, 92); font-weight: 600; }
.presup-full td.delta-down { background: rgba(238, 103, 35, .08); color: rgb(200, 80, 20); font-weight: 600; }

/* Envoltura con % vs. Contratado / Autorizado — tooltip propio (no el
   globito feo del navegador), mismo lenguaje visual que el de los KPIs */
.pf-pct-wrap {
  position: relative;
  display: inline-block;
  cursor: help;
  border-bottom: 1.5px dotted #b8bfce;
}
.pf-pct-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: rgb(34, 47, 92);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
  z-index: 60;
  pointer-events: none;
}
.pf-pct-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgb(34, 47, 92);
}
.pf-pct-wrap:hover .pf-pct-tip { display: block; }
.presup-full td.col-hl     { background: rgba(34, 47, 92, .07) !important; }
.presup-full td.row-hl     { background: rgba(34, 47, 92, .07) !important; }
.presup-full td.cell-hl    { background: rgba(34, 47, 92, .18) !important; outline: 2px solid rgba(34, 47, 92, .3); outline-offset: -1px; }

.delta-legend    { font-size: 10px; color: #999; }
.delta-up-sm     { color: rgb(34, 47, 92); font-weight: 700; }
.presup-footer   { font-size: 10px; color: #999; margin-top: 6px; font-style: italic; }

/* ── EDICIÓN DE PRESUPUESTO (admin) ──────────────────────────────────────── */
.presup-edit-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.presup-edit-btn,
.presup-save-btn,
.presup-cancel-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s ease;
}
.presup-edit-btn {
  background: #fff;
  border-color: rgb(34, 47, 92);
  color: rgb(34, 47, 92);
}
.presup-edit-btn:hover { background: rgba(34, 47, 92, .06); }
.presup-save-btn {
  background: rgb(34, 47, 92);
  color: #fff;
}
.presup-save-btn:hover { opacity: .88; }
.presup-save-btn:disabled { opacity: .55; cursor: default; }
.presup-cancel-btn {
  background: #fff;
  border-color: #ddd;
  color: #888;
}
.presup-cancel-btn:hover { background: #f5f5f5; }
.presup-edit-hint {
  font-size: 10.5px;
  color: #999;
  font-style: italic;
}
.presup-full td.pf-editable { background: #fff; }
.presup-full td.pf-calc     { background: #f7f8fa; color: #888; }
.presup-full input.pf-input {
  width: 100%;
  min-width: 78px;
  border: 1px solid rgba(34, 47, 92, .3);
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 11px;
  font-family: inherit;
  text-align: right;
  color: rgb(34, 47, 92);
  background: rgba(34, 47, 92, .04);
}
.presup-full input.pf-input:focus {
  outline: none;
  border-color: rgb(34, 47, 92);
  background: #fff;
}



/* ── N2 · RIESGOS Y LOGROS ────────────────────────────────── */

.riesgo-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.riesgo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.ri-logro  .riesgo-dot { background: #1D9E75; }
.ri-logro  span        { font-weight: 600; color: rgb(34, 47, 92); }
.ri-riesgo .riesgo-dot { background: rgb(238, 103, 35); }
.ri-riesgo span        { font-weight: 600; color: rgb(238, 103, 35); }
.ri-proceso .riesgo-dot { background: #ccc; }
.ri-proceso span        { color: #555; }

.riesgo-resumen {
  background: #f5f7ff;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 12px;
  line-height: 1.7;
  color: #333;
  border-left: 3px solid rgb(34, 47, 92);
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  background: rgb(238, 103, 35);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
  font-weight: 600;
}

.riesgo-legend {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.riesgo-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #999;
}


/* ── N3 · GALERÍA DE FOTOS ────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}


/* ── N2 · GALERÍA DE FOTOS POR CORTE (layout condicional por cantidad) ──
   1 foto      → ancho completo
   2 fotos     → lado a lado, mismo tamaño
   impares ≥3  → foto grande a la izquierda + columna de chiquitas a la derecha
   pares ≥4    → grid parejo de n/2 columnas × 2 filas
   ─────────────────────────────────────────────────────────────────────── */

.pgal-single img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  display: block;
}

.pgal-even {
  display: grid;
  gap: 8px;
}

.pgal-even img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  display: block;
}

.pgal-hero-layout {
  display: flex;
  gap: 8px;
  height: 420px;
}

.pgal-hero-layout .pgal-hero {
  flex: 2;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.pgal-hero-layout .pgal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pgal-hero-layout .pgal-side {
  flex: 1;
  display: grid;
  grid-auto-rows: 1fr;
  gap: 8px;
  min-width: 0;
  min-height: 0; /* clave: sin esto, un grid dentro de un flex item no se
                    encoge a la altura del contenedor y las filas de abajo
                    se salen del cuadro (se veían solo 2 de 4 fotos) */
}

.pgal-hero-layout .pgal-side img {
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  display: block;
}

/* Celular: la foto grande arriba, chiquitas debajo en fila (no columna angosta) */
@media (max-width: 640px) {
  .pgal-hero-layout {
    flex-direction: column;
    height: auto;
  }
  .pgal-hero-layout .pgal-hero {
    aspect-ratio: 16 / 9;
  }
  .pgal-hero-layout .pgal-side {
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-rows: auto;
    grid-auto-flow: row;
  }
  .pgal-hero-layout .pgal-side img {
    aspect-ratio: 4 / 3;
    height: auto;
  }
}


/* ── N3 · FORM DE ACTUALIZACIÓN SEMANAL (PM) ──────────────── */

.pm-section {
  background: #fff;
  border-radius: 10px;
  border: 2px dashed #d0d0d0;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.pm-title {
  font-size: 12px;
  font-weight: 700;
  color: rgb(34, 47, 92);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-badge {
  font-size: 10px;
  background: rgb(238, 103, 35);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
}

.pm-form {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.pm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pm-label {
  font-size: 11px;
  color: #999;
  font-weight: 500;
}

.pm-input {
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  color: #1a1a1a;
  outline: none;
  transition: border .15s;
  font-family: inherit;
}

.pm-input:focus {
  border-color: rgb(34, 47, 92);
}

textarea.pm-input {
  resize: vertical;
  min-height: 70px;
}

.pm-btn {
  background: rgb(34, 47, 92);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: background .15s;
}

.pm-btn:hover {
  background: rgb(238, 103, 35);
}


/* ── N3 · TABLA HISTÓRICO DE CORTES ───────────────────────── */

.hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.hist-table th {
  font-size: 9.5px;
  color: #6b7794;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 9px 14px;
  text-align: left;
  background: #f4f6fb;
  border-bottom: 2px solid #e8ebf2;
}

.hist-table th:first-child { border-radius: 8px 0 0 0; }
.hist-table th:last-child  { border-radius: 0 8px 0 0; }

.hist-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
  line-height: 1.55;
  vertical-align: top;
}

.hist-table tr:nth-child(even) td {
  background: #fafbfd;
}

.hist-table tr:last-child td {
  border-bottom: none;
}

.hist-table tr:hover td {
  background: #f4f6fb;
}

/* ── Bloque "Actualizar presupuesto con este corte" (PM) ─────────────── */
.ndp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.ndp-table th {
  font-size: 9px;
  color: #6b7794;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: left;
  background: #f4f6fb;
  border-bottom: 2px solid #e8ebf2;
}

.ndp-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
  vertical-align: middle;
}

.ndp-table .ndp-grupo td {
  padding-top: 12px;
  font-size: 10px;
  font-weight: 700;
  color: rgb(34, 47, 92);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: transparent;
  border-bottom: none;
}

.ndp-table .ndp-actual {
  color: #999;
  text-align: right;
}

.ndp-table input.ndp-input {
  width: 100%;
  min-width: 70px;
  box-sizing: border-box;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11.5px;
  font-family: inherit;
  text-align: right;
  color: rgb(238, 103, 35);
  font-weight: 600;
  outline: none;
}

.ndp-table input.ndp-input:focus {
  border-color: rgb(238, 103, 35);
  background: #fff6f0;
}

.ndp-table input.ndp-input.ndp-input-error {
  border-color: #d33;
  background: #fdeeee;
  color: #d33;
}

/* Sin margen desde antes de este corte (Disponible o Por Ejercer en 0) —
   se deja el input visible pero apagado, en vez de quitarlo. */
.ndp-table input.ndp-input:disabled {
  background: #f2f2f0;
  border-color: #e5e5e3;
  color: #bbb;
  cursor: not-allowed;
}

.ndp-disponible {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}

.ndp-nuevo {
  font-size: 9.5px;
  font-weight: 600;
  color: rgb(34, 47, 92);
  margin-top: 3px;
  min-height: 12px;
}

/* ── Tinte por moneda — para distinguir de un vistazo la columna de USD
   en las tablas donde conviven USD y MXN (Corning, BTS) ────────────────── */
.presup-full th.cur-usd,
.ndp-table th.cur-usd {
  background: rgba(34, 47, 92, .08);
  color: rgb(34, 47, 92);
}

.presup-full td.cur-usd,
.ndp-table td.cur-usd {
  background: rgba(34, 47, 92, .04);
}


/* ── RESPONSIVE · Móvil (< 640px) ────────────────────────── */

@media (max-width: 640px) {

  .header { padding: 0 1rem; }
  .header nav { display: none; }

  /* N1 */
  .metrics          { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pfv-kpi-card     { padding: .7rem .8rem; gap: 10px; }
  .pfv-kpi-icon     { width: 32px; height: 32px; border-radius: 9px; }
  .pfv-kpi-icon svg { width: 16px; height: 16px; }
  .pfv-kpi-ring svg { width: 32px; height: 32px; }
  .pfv-kpi-label    { font-size: 9px; margin-bottom: 3px; }
  .pfv-kpi-value,
  .metric-value     { font-size: 17px; }
  .pfv-kpi-sub,
  .metric-sub       { font-size: 9px; margin-top: 2px; }
  .pfv-kpi-delta    { font-size: 9px; min-height: 11px; margin-top: 2px; }
  .pfv-kpi-delta svg { width: 9px; height: 9px; }
  .cards-grid       { grid-template-columns: 1fr; }
  .proj-card        { min-height: 160px; }
  .tl-outer         { display: none; }
  .tl-mobile-list   { display: block; }

  /* N2 */
  .hero-kpis-row    { grid-template-columns: 1fr; }
  .kpis-grid        { grid-template-columns: 1fr 1fr; height: auto; gap: 8px; }
  .kpi-card         { padding: .65rem .75rem; }
  .kpi-label        { font-size: 9px; margin-bottom: 3px; }
  .kpi-value        { font-size: 16px; }
  .kpi-sub          { font-size: 9px; }
  .kpi-bar          { margin-top: 4px; height: 4px; }
  .info-grid        { grid-template-columns: 1fr 1fr; gap: 8px; padding: 1rem; }
  .info-cols        { grid-template-columns: 1fr; gap: 14px; padding: 1rem; }
  .cs-kpi-row       { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cs-pills-toggle  {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    font-size: 12px; font-weight: 600; color: rgb(34,47,92); font-family: inherit;
    background: #f7f8fa; border: 1px solid #e5e5e5; border-radius: 8px;
    padding: 9px 12px; margin-bottom: 8px; cursor: pointer;
  }
  .cs-pills-toggle-chev { font-size: 11px; transition: transform .2s; color: #999; }
  .cs-pills-toggle.open .cs-pills-toggle-chev { transform: rotate(180deg); }
  .cs-pills         { display: none; gap: 4px; }
  .cs-pills.open    { display: flex; }
  .cs-pill          { font-size: 10px; padding: 4px 10px; }
  .curva-svg        { min-width: 0; }
  .two-col          { grid-template-columns: 1fr; }
  .presup-full-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gallery          { grid-template-columns: 1fr 1fr; }
  .pgal-even        { grid-template-columns: 1fr 1fr !important; }
  .info-doc-pills   { gap: 6px; padding: .5rem 1rem; }
  .doc-pill         { font-size: 10px; padding: 5px 10px; }

  /* N3 */
  .pm-form { grid-template-columns: 1fr; }
  .hist-table th:last-child,
  .hist-table td:last-child { display: none; }

  /* General */
  .lvl2-content  { padding: 1rem; }
  .section-header { padding: .6rem 1rem; }
}


/* ── RESPONSIVE · Tablet (641–900px) ─────────────────────── */

@media (min-width: 641px) and (max-width: 900px) {
  .metrics    { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cs-kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .two-col    { grid-template-columns: 1fr; }
  .info-grid  { grid-template-columns: 1fr 1fr 1fr; }
  .info-cols  { grid-template-columns: 1fr 1fr; }
  .kpis-grid  { grid-template-columns: 1fr 1fr; height: auto; }
}


/* ============================================================
   PRECONSTRUCCIÓN — estilos exclusivos
   Aplican al tab de Preconstrucción (preconstruccion_tab__9_.html)
   ============================================================ */


/* ── PRECON · SECTION CARD (variante .sc) ────────────────────
   Equivalente a .section-card del v16 pero con nombre corto.
   ──────────────────────────────────────────────────────────── */

.sc {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.sc-title {
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ── PRECON · MÉTRICAS DE PORTAFOLIO ─────────────────────────
   Layout de 2 columnas: total grande (azul) + desglose por etapa
   ──────────────────────────────────────────────────────────── */

.metrics-wrap {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
  margin-bottom: 1.5rem;
}

/* Tarjeta grande — total de proyectos */
.m-total {
  background: rgb(34, 47, 92);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.m-total-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.m-total-val {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
}

.m-total-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, .35);
  margin-top: 5px;
}

/* Tarjeta desglose — filas por etapa */
.m-breakdown {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  padding: 1.25rem 1.5rem;
}

.m-bd-title {
  font-size: 10px;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  margin-bottom: 12px;
}

.m-bd-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.m-bd-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-bd-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.m-bd-name   { font-size: 12px; color: #666; flex: 1; }
.m-bd-count  { font-size: 22px; font-weight: 700; }
.m-bd-active { font-size: 10px; color: #bbb; text-align: right; }


/* ── PRECON · TIMELINE MULTI-PROYECTO ────────────────────────
   Timeline por año y quarter con barras de construcción por proyecto.
   Más complejo que el .tl-* del v16 (que es por hitos de un proyecto).
   ──────────────────────────────────────────────────────────── */

.tl-outer  { overflow-x: auto; }
.tl-wrap   { min-width: 640px; }
.tl-head   { margin-left: 170px; }

/* Encabezados: años */
.tl-years { display: grid; grid-template-columns: repeat(var(--tl-cols), 1fr); border-bottom: 1px solid #e0e0e0; }

.tl-year {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: rgb(34, 47, 92);
  padding: 4px 0;
  background: #f6f8fc;
  border-right: 1px solid #e8e8e8;
}

.tl-year:last-child { border-right: none; }

/* Quarters */
.tl-qs { display: grid; grid-template-columns: repeat(var(--tl-cols), 1fr); border-bottom: 1px solid #eee; }

.tl-q {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #bbb;
  padding: 3px 0;
  letter-spacing: .04em;
  border-right: 1px dashed #eee;
}

.tl-q:last-child { border-right: none; }

/* Meses */
.tl-months { display: grid; grid-template-columns: repeat(var(--tl-cols), 1fr); border-bottom: 2px solid #ddd; }

.tl-month           { text-align: center; font-size: 9px; color: #ccc; padding: 2px 0 4px; }
.tl-month.q1        { color: #aaa; font-weight: 600; border-left: 1px solid #e0e0e0; }
.tl-month.today     { color: rgb(238, 103, 35); font-weight: 700; }

/* Body de filas */
.tl-body { position: relative; padding: 6px 0 2px; overflow: hidden; }

/* Línea vertical de hoy */
.tl-corte-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgb(238, 103, 35);
  opacity: .5;
  z-index: 10;
  pointer-events: none;
}

.tl-corte-tag {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 700;
  color: rgb(238, 103, 35);
  white-space: nowrap;
  background: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(238, 103, 35, .25);
  z-index: 11;
}

/* Separadores de categoría */
.tl-cat-sep     { display: flex; align-items: center; margin-top: 14px; margin-bottom: 5px; }
.tl-cat-sep-lbl { width: 170px; flex-shrink: 0; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; text-align: right; padding-right: 10px; }
.tl-cat-sep-line { flex: 1; height: 1px; }

/* Filas de proyecto */
.tl-row { display: flex; align-items: center; margin-bottom: 5px; min-height: 28px; }

.tl-row-lbl {
  width: 170px;
  flex-shrink: 0;
  font-size: 10px;
  color: #555;
  padding-right: 10px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .12s;
}

.tl-row-lbl:hover { opacity: .7; }

.tl-track { flex: 1; position: relative; height: 28px; }

/* Bandas y líneas de quarter sobre el body */
.tl-qband { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.tl-qline { position: absolute; top: 0; bottom: 0; width: 1px; background: #e8e8e8; pointer-events: none; z-index: 1; }

/* Barras de construcción */
.tl-bar-cons {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 10px;
  border-radius: 3px;
  z-index: 2;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.tl-bar-lbl { font-size: 7.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; padding: 0 5px; }

/* Dots de hito */
.tl-dot     { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; z-index: 3; }
.tl-dot-lbl { position: absolute; transform: translateX(-50%); font-size: 7.5px; font-weight: 600; white-space: nowrap; z-index: 3; top: calc(50% + 8px); }
.tl-tbd     { position: absolute; top: 50%; transform: translateY(-50%); left: 4px; font-size: 9px; color: #ccc; font-style: italic; }

/* Leyenda */
.tl-legend      { display: flex; gap: 18px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #f0f0f0; flex-wrap: wrap; align-items: center; }
.tl-leg-item    { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #666; }
.tl-leg-solid   { width: 20px; height: 5px; border-radius: 3px; }
.tl-leg-today   { width: 2px; height: 14px; background: rgb(238, 103, 35); border-radius: 1px; }
.tl-leg-cats    { display: flex; gap: 10px; margin-left: auto; }
.tl-leg-cat     { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #888; }
.tl-leg-cat-dot { width: 7px; height: 7px; border-radius: 50%; }


/* ── PRECON · MAPA LEAFLET ───────────────────────────────────
   Mapa interactivo con burbujas de parques y popups de proyectos
   ──────────────────────────────────────────────────────────── */

#mapContainer {
  height: 340px;
  border-radius: 8px;
  overflow: hidden;
}

/* Burbuja flotante sobre el mapa */
.map-bubble {
  background: #fff;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Jost', sans-serif;
}

.map-bubble-dot { width: 7px; height: 7px; border-radius: 50%; }

/* Popup de Leaflet */
.leaflet-popup-content-wrapper { border-radius: 10px; padding: 0; overflow: hidden; box-shadow: 0 4px 20px rgba(0, 0, 0, .15); }
.leaflet-popup-content         { margin: 0; min-width: 230px; }
.leaflet-popup-tip-container   { display: none; }

.map-pop          { padding: 14px; font-family: 'Jost', sans-serif; }
.map-pop-park     { font-size: 13px; font-weight: 700; color: rgb(34, 47, 92); margin-bottom: 2px; }
.map-pop-cnt      { font-size: 10px; color: #bbb; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }

.map-pop-proj      { border-radius: 6px; padding: 6px 8px; cursor: pointer; transition: background .1s; }
.map-pop-proj:hover { background: #f4f6fb; }
.map-pop-proj-top   { display: flex; align-items: center; gap: 7px; }
.map-pop-proj-dot   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.map-pop-proj-name  { font-size: 11px; font-weight: 600; color: #333; flex: 1; }
.map-pop-proj-arrow { font-size: 11px; font-weight: 700; color: rgb(34, 47, 92); }
.map-pop-proj-meta  { font-size: 10px; color: #aaa; margin-top: 2px; padding-left: 14px; }

/* Foto del parque dentro del popup */
.map-pop-img             { width: 100%; height: 90px; border-radius: 7px; overflow: hidden; margin-bottom: 10px; background: #f0f0ee; display: flex; align-items: center; justify-content: center; }
.map-pop-img img         { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-pop-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #ccc; font-style: italic; }


/* ── PRECON · ACORDEÓN DE PARQUES ────────────────────────────
   Lista de parques industriales colapsable, cada uno con sus proyectos
   ──────────────────────────────────────────────────────────── */

.acc-toolbar     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.acc-toolbar-lbl { font-size: 10px; font-weight: 700; color: #bbb; text-transform: uppercase; letter-spacing: .07em; }

.acc-btn-all {
  font-size: 11px;
  color: rgb(34, 47, 92);
  cursor: pointer;
  padding: 4px 12px;
  border: 1px solid rgb(34, 47, 92);
  border-radius: 6px;
  background: #fff;
  font-family: 'Jost', sans-serif;
  transition: background .15s, color .15s;
}

.acc-btn-all:hover { background: rgb(34, 47, 92); color: #fff; }

.acc-item { background: #fff; border-radius: 10px; border: 1px solid #e0e0e0; margin-bottom: 8px; overflow: hidden; }

.acc-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
}

.acc-hdr:hover { background: #fafafa; }

.acc-stripe { width: 5px; height: 36px; border-radius: 3px; flex-shrink: 0; }
.acc-info   { flex: 1; }
.acc-title  { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.acc-pills { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.acc-pill  { font-size: 8.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }

/* Colores de pills por etapa */
.pill-pre  { background: rgba(238, 103, 35, .1); color: rgb(238, 103, 35); }
.pill-cons { background: rgba(34, 47, 92, .1);   color: rgb(34, 47, 92); }
.pill-term { background: rgba(29, 158, 117, .1); color: #1D9E75; }
.pill-stk  { background: rgba(139, 92, 246, .1); color: #8b5cf6; }

.acc-count     { text-align: right; }
.acc-count-n   { font-size: 26px; font-weight: 800; line-height: 1; }
.acc-count-lbl { font-size: 9px; color: #bbb; }

.acc-chevron          { width: 18px; height: 18px; color: #ccc; transition: transform .2s; flex-shrink: 0; }
.acc-chevron svg      { width: 18px; height: 18px; }
.acc-item.open .acc-chevron { transform: rotate(180deg); }

.acc-body               { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.acc-item.open .acc-body { max-height: 3000px; }
.acc-body-inner         { padding: 0 16px 16px; }


/* ── PRECON · CARDS DE PROYECTOS (variante precon) ───────────
   Más compactas que las del v16 (100px vs 155px de alto)
   e incluyen badge de etapa y área en lugar de donuts
   ──────────────────────────────────────────────────────────── */

/* Nota: .cards-grid, .proj-card, .card-info, .card-tipo,
   .card-name, .card-meta ya están definidos en el v16.
   Solo se agregan las clases nuevas o con valores distintos. */

.card-img-bg      { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.card-img-bg img  { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-img-pattern {
  position: absolute;
  inset: 0;
  opacity: .07;
  background-image: repeating-linear-gradient(45deg, #fff 0, #fff 1px, transparent 0, transparent 50%);
  background-size: 8px 8px;
}

.card-img-overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .28) 100%); }

/* Badge de etapa (reemplaza el semáforo del v16) */
.card-badge { position: absolute; top: 8px; left: 8px; font-size: 8px; font-weight: 700; padding: 2px 7px; border-radius: 20px; z-index: 2; }
.badge-pre  { background: rgba(238, 103, 35, .92); color: #fff; }
.badge-cons { background: rgba(34, 47, 92, .92);   color: #fff; }
.badge-term { background: rgba(29, 158, 117, .92); color: #fff; }
.badge-stk  { background: rgba(139, 92, 246, .92); color: #fff; }
.badge-tbd  { background: rgba(160, 160, 160, .85); color: #fff; }

/* Área rentable en esquina inferior derecha */
.card-area { position: absolute; bottom: 7px; right: 8px; font-size: 9px; font-weight: 600; color: rgba(255, 255, 255, .8); z-index: 2; }

/* Card activa (seleccionada) */
.proj-card.card-active { border-color: rgb(34, 47, 92); box-shadow: 0 0 0 2px rgba(34, 47, 92, .2); }


/* ── PRECON · LAYOUT INLINE (acordeón + N2 lado a lado) ──────
   Al seleccionar un proyecto, el acordeón se comprime a la izquierda
   y el N2 aparece a la derecha sin salir de la página
   ──────────────────────────────────────────────────────────── */

.inline-layout { display: flex; gap: 16px; align-items: flex-start; transition: all .3s ease; }
.inline-left   { flex: 1; min-width: 0; transition: all .3s ease; }

/* Estado comprimido al abrir N2 */
.inline-left.compressed                         { flex: 0 0 280px; min-width: 280px; }
.inline-left.compressed .cards-grid             { grid-template-columns: 1fr; }
.inline-left.compressed .proj-card              { display: flex; height: 60px; }
.inline-left.compressed .card-img               { width: 70px; height: 60px; flex-shrink: 0; }
.inline-left.compressed .card-info              { padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; }
.inline-left.compressed .card-tipo              { display: none; }
.inline-left.compressed .card-name              { font-size: 11px; margin-bottom: 0; }
.inline-left.compressed .card-meta              { font-size: 9px; }
.inline-left.compressed .card-area              { display: none; }
/* Elementos propios del rediseño pfv- (badges junto al nombre, fila de
   entrega/inversión, barras de obra/financiero) — se ocultan igual que
   .card-tipo/.card-area de arriba, así la mini-card solo muestra foto +
   nombre en la barra lateral comprimida. */
.inline-left.compressed .pfv-card-pills          { display: none; }
.inline-left.compressed .pfv-card-row            { display: none; }
.inline-left.compressed .pfv-bars                { display: none; }
.inline-left.compressed .pfv-card-name-row       { margin-bottom: 0; }

/* Panel N2 inline */
.inline-n2 { flex: 1; min-width: 0; background: #fff; border-radius: 10px; border: 1px solid #e0e0e0; overflow: hidden; }

/* Header del panel N2 inline */
.n2-inline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  position: relative;
}

.n2-close-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  font-family: 'Jost', sans-serif;
  transition: all .12s;
}

.n2-close-btn:hover  { color: rgb(34, 47, 92); border-color: rgb(34, 47, 92); }
.n2-inline-title     { font-size: 13px; font-weight: 700; color: rgb(34, 47, 92); flex: 1; }
.n2-inline-body      { overflow-y: auto; max-height: calc(100vh - 200px); padding: 1.25rem; }

/* Boton "Solicitar inicio de construccion" — solo costos/admin, ver cargarRolUsuario() en preconstruccion_v2.html */
.n2-solicitar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: rgb(238, 103, 35);
  font-family: 'Jost', sans-serif;
  white-space: nowrap;
  transition: all .12s;
}
.n2-solicitar-btn:hover { background: rgb(210, 88, 25); }

.n2-aviso-toast {
  position: absolute;
  top: calc(100% + 6px);
  right: 16px;
  max-width: 320px;
  background: rgb(34, 47, 92);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(34,47,92,.20);
  z-index: 20;
}


/* ── PRECON · N2 VISTA COMPLETA (modal full-screen) ──────────
   Se activa al hacer click en "ver ficha completa"
   Desliza desde abajo cubriendo toda la pantalla
   ──────────────────────────────────────────────────────────── */

.n2-view {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  background: #f0f0ee;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}

.n2-view.open { transform: translateY(0); }

/* Barra superior del modal */
.n2-topbar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 14px;
  flex-shrink: 0;
}

.n2-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgb(34, 47, 92);
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-family: 'Jost', sans-serif;
  transition: background .12s;
}

.n2-back:hover              { background: #f0f4fb; }
.n2-back svg                { width: 14px; height: 14px; stroke: rgb(34, 47, 92); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.n2-topbar-name             { font-size: 13px; font-weight: 600; color: #999; flex: 1; }
.n2-topbar-logo             { font-size: 13px; font-weight: 700; color: rgb(34, 47, 92); }

/* Layout del modal: sidebar + contenido */
.n2-layout  { display: flex; flex: 1; overflow: hidden; }

/* Sidebar de navegación de proyectos */
.n2-sb          { width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid #e0e0e0; overflow-y: auto; }
.n2-sb-cat      { border-bottom: 1px solid #f0f0f0; }
.n2-sb-cat-hdr  { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; user-select: none; transition: background .1s; }
.n2-sb-cat-hdr:hover { background: #fafafa; }
.n2-sb-stripe        { width: 4px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.n2-sb-cat-name      { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; flex: 1; }
.n2-sb-cat-cnt       { font-size: 10px; color: #bbb; }
.n2-sb-chev          { width: 13px; height: 13px; color: #ccc; transition: transform .18s; flex-shrink: 0; }
.n2-sb-chev svg      { width: 13px; height: 13px; }
.n2-sb-cat.sb-open .n2-sb-chev  { transform: rotate(180deg); }
.n2-sb-projs                     { max-height: 0; overflow: hidden; transition: max-height .22s ease; }
.n2-sb-cat.sb-open .n2-sb-projs { max-height: 600px; }

.n2-sb-proj {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 26px;
  cursor: pointer;
  font-size: 11px;
  color: #777;
  transition: background .1s;
  line-height: 1.3;
}

.n2-sb-proj:hover        { background: #f4f6fb; }
.n2-sb-proj.active       { background: #eef1f9; color: rgb(34, 47, 92); font-weight: 600; }
.n2-sb-proj-dot          { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.n2-sb-proj-lock         { font-size: 9px; color: #ccc; margin-left: auto; }

/* Área de contenido del modal */
.n2-content { flex: 1; overflow-y: auto; padding: 1.5rem 2rem; }


/* ── PRECON · N2 CONTENIDO INLINE ────────────────────────────
   Hero + KPIs, Area Mix, Checklist de permisos, Galería, Comentarios
   ──────────────────────────────────────────────────────────── */

/* Hero + KPIs en fila (1fr + 220px) */
.n2-top-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
  margin-bottom: 1rem;
  align-items: stretch;
}

.n2-hero {
  border-radius: 10px;
  overflow: hidden;
  height: 200px;
  position: relative;
  background: rgb(24, 37, 72);
  min-width: 0;
  cursor: default;
}

.n2-hero-img     { width: 100%; height: 100%; object-fit: cover; display: block; }
.n2-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(10, 20, 60, .78) 35%, rgba(10, 20, 60, .12) 80%); }
.n2-hero-text    { position: absolute; bottom: 0; left: 0; padding: 1.1rem 1.25rem; }
.n2-hero-tipo    { font-size: 10px; color: rgb(238, 103, 35); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.n2-hero-title   { font-size: 22px; font-weight: 800; color: #fff; line-height: 1.15; }
.n2-hero-sub     { font-size: 11px; color: rgba(255, 255, 255, .55); margin-top: 3px; }

/* KPIs 2×2 al lado del hero */
.n2-kpis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: 200px;
}

.n2-kpi         { background: #fff; border-radius: 10px; border: 1px solid #e0e0e0; padding: .75rem 1rem; display: flex; flex-direction: column; justify-content: center; }
.n2-kpi-lbl     { font-size: 9.5px; color: #aaa; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.n2-kpi-val     { font-size: 18px; font-weight: 700; color: rgb(34, 47, 92); line-height: 1; }
.n2-kpi-sub     { font-size: 9.5px; color: #bbb; margin-top: 2px; }
.n2-kpi-bar     { margin-top: 6px; height: 4px; background: #f0f0ee; border-radius: 3px; overflow: hidden; }
.n2-kpi-bar-fill { height: 100%; border-radius: 3px; }

/* Barra apilada de mix de área (BTS / Especulativo / Stacking) */
.n2-areaMix      { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: .875rem 1rem; margin-bottom: 1rem; }
.n2-mix-title    { font-size: 9.5px; color: #aaa; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; font-weight: 700; }
.n2-mix-bar-stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
.n2-mix-seg      { height: 100%; transition: width .4s ease; }
.n2-mix-labels   { display: flex; justify-content: space-between; }
.n2-mix-label    { display: flex; align-items: center; gap: 6px; }
.n2-mix-label-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.n2-mix-label-name { font-size: 10px; color: #666; }
.n2-mix-label-pct  { font-size: 13px; font-weight: 700; margin-left: 4px; }
.n2-mix-label-ha   { font-size: 10px; color: #bbb; margin-left: 2px; }

/* Checklist de permisos/trámites agrupados por categoría */
.n2-checklist   { display: flex; flex-direction: column; gap: 10px; }
.n2-ck-grupo    { display: flex; flex-direction: column; gap: 6px; }
.n2-ck-grupo-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #bbb; }
.n2-ck-pills    { display: flex; flex-wrap: wrap; gap: 6px; }
.n2-ck-pill     { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 600; border: 1.5px solid transparent; }
.n2-ck-completo  { background: rgba(29, 158, 117, .1);  color: #1D9E75; border-color: rgba(29, 158, 117, .25); }
.n2-ck-parcial   { background: rgba(238, 163, 35, .12); color: #c08a00; border-color: rgba(238, 163, 35, .3); }
.n2-ck-pendiente { background: #f5f5f5; color: #bbb; border-color: #e8e8e8; }
.n2-ck-icon      { font-size: 10px; }

/* Títulos de sección dentro de N2 */
.n2-sec     { margin-bottom: 1.25rem; }
.n2-sec-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #bbb; margin-bottom: 10px; }

/* Galería: foto principal grande + mapa pequeño */
.n2-gallery    { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-bottom: 1rem; }
.n2-photo      { border-radius: 8px; overflow: hidden; position: relative; background: #e8e8e8; }
.n2-photo img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.n2-photo-main  { aspect-ratio: 16/10; }
.n2-photo-small { aspect-ratio: 4/3; }
.n2-photo-cap   { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 8px; background: rgba(10, 15, 35, .45); font-size: 9px; color: rgba(255, 255, 255, .9); font-weight: 500; }

/* Flechas de navegación hover sobre la foto principal */
.n2-photo-arrows { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-around; padding: 0 16px; pointer-events: none; }
.n2-arrow-btn    { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .85); display: flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: all; transition: background .15s; position: relative; }
.n2-arrow-btn:hover { background: #fff; }
.n2-arrow-btn svg   { width: 14px; height: 14px; stroke: rgb(34, 47, 92); stroke-width: 2.5; fill: none; stroke-linecap: round; }

/* Preview flotante al hacer hover en las flechas */
.n2-preview { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 180px; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 20; }
.n2-arrow-btn:hover .n2-preview { opacity: 1; }
.n2-preview img     { width: 100%; height: 110px; object-fit: cover; display: block; }
.n2-preview-cap     { background: rgba(10, 15, 35, .8); color: #fff; font-size: 9px; padding: 3px 7px; font-weight: 500; }

/* Comentarios de avance como pills */
.n2-comments     { display: flex; flex-direction: column; gap: 8px; }
.n2-comment-pill { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; }
.n2-comment-num  { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; color: #fff; flex-shrink: 0; margin-top: 1px; }
.n2-comment-text { font-size: 11.5px; color: #555; line-height: 1.55; }

/* Estado vacío */
.n2-empty      { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 200px; gap: 8px; color: #ccc; }
.n2-empty-icon { font-size: 36px; }
.n2-empty-text { font-size: 13px; }

/* ============================================================
   PATCH — Timeline aligned grid + real construction overlay
   ============================================================ */

/* One shared grid for year / quarter / month headers */
.tl-years,
.tl-qs,
.tl-months {
  display: grid !important;
  grid-template-columns: repeat(var(--tl-cols), minmax(0, 1fr)) !important;
}

.tl-year,
.tl-q,
.tl-month {
  min-width: 0;
}

.tl-month {
  flex: unset !important;
}

/* Extra vertical room when baseline + real dates are shown */
.tl-row {
  min-height: 40px;
  margin-bottom: 8px;
}

.tl-track {
  height: 40px;
}

/* Baseline construction bar: visible but secondary */
.tl-bar-cons-baseline {
  top: 63% !important;
  height: 6px !important;
  opacity: .34;
  z-index: 2;
}

.tl-bar-cons-baseline .tl-bar-lbl {
  display: none;
}

/* Real construction bar: primary bar above baseline */
.tl-bar-real {
  position: absolute;
  top: 36%;
  transform: translateY(-50%);
  height: 10px;
  border-radius: 3px;
  z-index: 4;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}

/* Baseline milestone dot + label */
.tl-dot-baseline {
  top: 63% !important;
  width: 7px !important;
  height: 7px !important;
  opacity: .5;
  z-index: 2 !important;
}

.tl-dot-lbl-baseline {
  top: calc(63% + 7px) !important;
  color: #7f879d !important;
  opacity: .9;
  font-weight: 600;
}

/* Real milestone dot + label */
.tl-dot-real {
  top: 36% !important;
  z-index: 5 !important;
}

.tl-dot-lbl-real {
  top: calc(36% - 18px) !important;
  font-weight: 800;
  background: rgba(255,255,255,.85);
  padding: 0 3px;
  border-radius: 3px;
}


/* ── PRECON · FILTRO DE ESTATUS EN PIPELINE ───────────────── */
.tl-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: -6px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.tl-filter-btn {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #999;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all .15s ease;
}

.tl-filter-btn:hover {
  color: rgb(34,47,92);
  border-color: rgba(34,47,92,.35);
  background: #f6f8fc;
}

.tl-filter-btn.active {
  color: #fff;
  background: rgb(34,47,92);
  border-color: rgb(34,47,92);
}

/* ============================================================
   EcoS LIGHT THEME UPDATE — Executive / Tech Accent
   Mantiene light mode y agrega identidad visual alineada a PPT
   ============================================================ */

:root {
  --gp-navy: rgb(34, 47, 92);
  --gp-navy-2: #32417A;
  --gp-orange: rgb(238, 103, 35);

  --ecos-blue: #3B82F6;
  --ecos-purple: #8B5CF6;
  --ecos-green: #1D9E75;
  --ecos-cyan: #22D3EE;

  --bg-app: #F5F6FA;
  --bg-card: rgba(255, 255, 255, .94);
  --text-main: #172033;
  --text-muted: #8A94A6;
  --border-soft: rgba(34, 47, 92, .09);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-soft: 0 10px 30px rgba(34, 47, 92, .08);
  --shadow-hover: 0 18px 46px rgba(34, 47, 92, .15);
  --shadow-orange: 0 10px 24px rgba(238, 103, 35, .22);

  --gradient-ecos: linear-gradient(90deg, var(--gp-orange), var(--ecos-purple), var(--ecos-blue));
  --gradient-gp: linear-gradient(90deg, var(--gp-navy), var(--gp-navy-2));
}

/* ── BASE / BACKGROUND ───────────────────────────────────── */
body {
  color: var(--text-main);
  background:
    radial-gradient(circle at 8% 0%, rgba(59, 130, 246, .10), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(238, 103, 35, .10), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(139, 92, 246, .06), transparent 34%),
    linear-gradient(180deg, #F8F9FC 0%, var(--bg-app) 100%);
}

.main {
  max-width: none;
  padding: 100px 32px 64px;
}

/* ── HEADER / TABS ───────────────────────────────────────── */
.header {
  background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 18px rgba(34, 47, 92, .06);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.tabs {
  background: rgba(255, 255, 255, .80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.tab {
  color: var(--text-muted);
  transition: color .18s ease;
}

.tab:hover,
.tab.active {
  color: var(--gp-navy);
}

.tab.active {
  border-bottom-color: transparent;
  font-weight: 700;
  position: relative;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--gradient-ecos);
}

.corte {
  color: var(--text-muted);
  font-weight: 500;
}

/* ── GENERIC CARDS ───────────────────────────────────────── */
.metric,
.section-card,
.proj-card,
.kpi-card,
.lvl2-section,
.sc,
.m-breakdown,
.acc-cat,
.inline-n2,
.cs-kpi-card,
.info-item,
.pm-section {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.section-card,
.sc,
.m-total,
.m-breakdown,
.lvl2-section {
  overflow: hidden;
}

/* .m-total mantiene su propio fondo azul marino (definido arriba) —
   solo hereda el box-shadow y el radius del set genérico, no el fondo/borde claros */
.m-total {
  box-shadow: var(--shadow-soft);
}

.section-title,
.cards-title,
.sc-title,
.m-bd-title,
.acc-toolbar-lbl,
.metric-label,
.kpi-label,
.cs-kpi-label,
.info-label {
  color: var(--text-muted);
  letter-spacing: .08em;
}

/* ── KPI / METRICS — sober executive version ──────────────── */
.metric {
  position: relative;
  border-width: 3px 1px 1px 1px;
  border-style: solid;
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--gp-navy), var(--gp-navy-2)) border-box;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  transition: transform .20s ease, box-shadow .20s ease;
}

.metric:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  z-index: 50;
}

.metric-value {
  color: var(--gp-navy) !important;
}

.metric-label {
  color: #7F8AA3;
}

.metric-sub {
  color: #A9B0BE;
}

/* KPI internos también sobrios; el color queda para gráficos y estados */
.kpi-value,
.info-value,
.card-name {
  color: var(--gp-navy);
}

.kpi-card,
.cs-kpi-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.kpi-card:hover,
.cs-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(34, 47, 92, .16);
}

.cs-kpi-card-accent {
  background: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%);
  border-color: rgba(34, 47, 92, .12);
}

/* ── PROJECT CARDS ───────────────────────────────────────── */
.proj-card {
  border-radius: var(--radius-lg);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.proj-card:hover {
  transform: translateY(-5px);
  border-color: rgba(238, 103, 35, .28);
  box-shadow: var(--shadow-hover);
}


.card-tipo,
.hero-tipo {
  color: var(--gp-orange);
}

.card-semaforo {
  box-shadow: 0 0 0 4px rgba(255,255,255,.25), 0 6px 18px rgba(0,0,0,.18);
}

/* ── BUTTONS / PILLS ─────────────────────────────────────── */
.tl-filter-btn,
.cs-pill,
.doc-pill,
.acc-btn-all,
.n2-close-btn,
.pm-btn {
  border-radius: 999px;
  transition: all .18s ease;
}

.tl-filter-btn.active,
.cs-pill-active,
.doc-pill-active,
.pm-btn {
  background: linear-gradient(90deg, var(--gp-navy), var(--gp-navy-2));
  border-color: var(--gp-navy);
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(34, 47, 92, .16);
}

.tl-filter-btn:hover,
.cs-pill:hover,
.doc-pill-active:hover,
.acc-btn-all:hover,
.n2-close-btn:hover,
.pm-btn:hover {
  border-color: var(--gp-orange);
  color: var(--gp-orange);
  box-shadow: var(--shadow-orange);
}

.pm-btn:hover {
  color: #fff;
  background: linear-gradient(90deg, var(--gp-orange), var(--ecos-purple));
}

.ai-badge,
.pm-badge {
  background: linear-gradient(90deg, var(--gp-orange), var(--ecos-purple));
  box-shadow: 0 6px 16px rgba(238, 103, 35, .22);
}

/* ── SECTION HEADERS ─────────────────────────────────────── */
.sec-hdr {
  background: var(--gradient-gp);
  color: #fff;
}

.sec-hdr::after {
  content: "";
  position: absolute;
}

.sec-hdr-title {
  letter-spacing: .08em;
}

.lvl2-section-body:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, .04), rgba(238, 103, 35, .035));
}

.riesgo-resumen {
  background: linear-gradient(90deg, rgba(59, 130, 246, .07), rgba(255,255,255,.9));
  border-left-color: var(--ecos-blue);
}

/* ── TIMELINES ───────────────────────────────────────────── */
.tl-month.today,
.tl-row-label:hover,
.lvl2-back:hover,
.lvl2-tab:hover {
  color: var(--gp-orange);
}

.tl-month.today::before,
.tl-today-line,
.tl-corte-line {
  background: var(--gp-orange) !important;
}

.tl-prog-bar,
.ptl-fill {
  background: var(--gradient-gp);
}

.ptl-dot,
.tl-dot {
  box-shadow: 0 0 0 2px currentColor, 0 8px 18px rgba(34, 47, 92, .16);
}

/* ── HERO ───────────────────────────────────────────────── */
.hero-wrap {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hero-overlay {
  background:
    linear-gradient(to right, rgba(10, 20, 60, .78) 34%, rgba(10, 20, 60, .26)),
    radial-gradient(circle at 90% 15%, rgba(238, 103, 35, .36), transparent 34%);
}

.hero-name {
  letter-spacing: -.02em;
}

.hero-expand {
  background: var(--bg-card);
  border-color: var(--border-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── TABLES / BUDGET ─────────────────────────────────────── */
.presup-sm tr.sm-bold td,
.presup-full tr.pf-sub td {
  color: var(--gp-navy);
}

.presup-sm tr.sm-total td,
.presup-full th {
  background: var(--gradient-gp);
}

.presup-full .grp {
  background: #1A254C;
}

.presup-full tr.pf-total td {
  background: linear-gradient(90deg, var(--gp-orange), #F1873B);
}

.presup-full td.delta-up {
  background: rgba(59, 130, 246, .08);
  color: var(--ecos-blue);
}

.presup-full td.delta-down {
  background: rgba(238, 103, 35, .09);
  color: #C84F14;
}

.presup-full td.cell-hl {
  background: rgba(139, 92, 246, .14) !important;
  outline: 2px solid rgba(139, 92, 246, .28);
}

/* ── MAP / POPUPS ────────────────────────────────────────── */
.map-bubble,
.map-pop,
.map-pop-proj {
  border-radius: var(--radius-md);
}

.map-bubble {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(34,47,92,.12);
}

/* ── GALLERY / IMAGES ────────────────────────────────────── */
.gallery img {
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(34,47,92,.10);
  transition: transform .20s ease, box-shadow .20s ease;
}

.gallery img:hover {
  transform: scale(1.015);
  box-shadow: var(--shadow-hover);
}

/* ── MICROINTERACTIONS ───────────────────────────────────── */
.lvl2-tab.active {
  color: var(--gp-navy);
  border-bottom-color: transparent;
  position: relative;
}

.lvl2-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--gradient-ecos);
}

.pm-input:focus {
  border-color: var(--ecos-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .10);
}

/* ── RESPONSIVE CLEANUP ──────────────────────────────────── */
@media (max-width: 900px) {
  .main {
    padding: 1rem;
  }

  .metrics,
  .cs-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-kpis-row,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .metrics,
  .cs-kpi-row,
  .cards-grid,
  .info-grid,
  .info-cols {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   EcoS · Project card premium microinteractions
   Light executive mode — no extra top line
   ============================================================ */

.proj-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(34, 47, 92, .10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform .28s cubic-bezier(.22,.61,.36,1),
    box-shadow .28s cubic-bezier(.22,.61,.36,1),
    border-color .28s cubic-bezier(.22,.61,.36,1);
}

.proj-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 47, 92, .18);
  box-shadow: 0 18px 40px rgba(25, 35, 70, .18);
}

.card-img {
  transition:
    transform .55s ease,
    filter .55s ease;
  transform-origin: center center;
}

.proj-card:hover .card-img {
  transform: scale(1.035);
  filter: brightness(1.05);
}

.card-donuts {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18));
}

.donut-wrap {
  opacity: 0;
  transform: translateY(10px) scale(.92);
  animation: ecosDonutFadeIn .55s ease forwards;
}

.donut-wrap:nth-child(1) {
  animation-delay: .12s;
}

.donut-wrap:nth-child(2) {
  animation-delay: .24s;
}

@keyframes ecosDonutFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.90);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   PORTAFOLIO — VISTA GENERAL (N1 de construcción)
   Clases reutilizables pfv-* — prefijo distinto de .kpi-card
   (que ya se usa en los paneles N2 con otro layout) para no
   pisar nada existente.
   ============================================================ */

.pfv-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pfv-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.pfv-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.pfv-kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pfv-kpi-icon svg {
  width: 23px;
  height: 23px;
}

.pfv-kpi-ring {
  flex-shrink: 0;
  display: flex;
}

.pfv-kpi-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.pfv-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.pfv-kpi-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

@media (max-width: 1100px) {
  .pfv-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pfv-kpis {
    grid-template-columns: 1fr;
  }
}

.pfv-kpi-delta {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 500;
  margin-top: 4px;
  min-height: 14px;
}

.pfv-kpi-delta svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.pfv-kpi-delta.up { color: var(--ecos-green, #1D9E75); }
.pfv-kpi-delta.down { color: rgb(238, 103, 35); }
.pfv-kpi-delta.flat { color: var(--text-muted); }

/* ── Header de la vista (saludo + buscador + campana + avatar) ── */
.pfv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.pfv-greeting-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pfv-greeting-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, .14), rgba(139, 92, 246, .14));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pfv-greeting-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--ecos-blue);
}

.pfv-greeting h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 3px;
  font-family: inherit;
}

.pfv-greeting p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.pfv-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pfv-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  padding: 9px 14px;
  min-width: 240px;
  box-shadow: 0 4px 14px rgba(34, 47, 92, .06);
}

.pfv-search svg {
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  flex-shrink: 0;
}

.pfv-search input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-main);
  flex: 1;
  background: transparent;
}

.pfv-search input::placeholder {
  color: var(--text-muted);
}

.pfv-search kbd {
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: inherit;
}

.pfv-bell {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(34, 47, 92, .06);
  flex-shrink: 0;
}

.pfv-bell svg {
  width: 17px;
  height: 17px;
  stroke: var(--text-muted);
}

.pfv-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--border-soft);
}

.pfv-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gp-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.pfv-avatar-text {
  line-height: 1.3;
}

.pfv-avatar-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.pfv-avatar-role {
  font-size: 10.5px;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .pfv-header-right {
    width: 100%;
  }
  .pfv-search {
    flex: 1;
    min-width: 0;
  }
}

/* ── Cards de proyecto — badges + barras (reusa .proj-card/.card-img/
   .card-overlay/.card-name/.card-info ya existentes, solo agrega esto) ── */
.pfv-card-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.pfv-card-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pfv-card-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
}

.pfv-card-badge-status {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: rgba(34, 47, 92, .06);
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-main);
  white-space: nowrap;
}

.pfv-card-badge-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pfv-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  margin: 4px 0 10px;
}

.pfv-card-row span:last-child {
  font-weight: 700;
  color: var(--text-main);
}

.pfv-bars {
  display: flex;
  gap: 12px;
}

.pfv-bar-col {
  flex: 1;
}

.pfv-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pfv-bar-top b {
  color: var(--text-main);
  font-size: 10.5px;
}

.pfv-bar-track {
  height: 5px;
  border-radius: 4px;
  background: rgba(34, 47, 92, .08);
  overflow: hidden;
}

.pfv-bar-fill {
  height: 100%;
  border-radius: 4px;
}

/* ── Panel título estilo "vista general" (usa .section-card ya existente
   como contenedor, solo cambia el encabezado) ── */
.pfv-panel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Timeline de hitos clave (puntos), reemplaza el Gantt de barras ── */
.pfv-tl-outer {
  overflow-x: auto;
}

.pfv-tl-scale {
  display: flex;
  margin-left: 150px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 6px;
  margin-bottom: 4px;
  position: relative;
}

.pfv-tl-scale span {
  font-size: 9.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  text-align: center;
}

.pfv-tl-row {
  display: flex;
  align-items: center;
  min-height: 34px;
  position: relative;
}

.pfv-tl-label {
  width: 150px;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.pfv-tl-label:hover {
  color: rgb(238, 103, 35);
}

.pfv-tl-label span {
  display: block;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.pfv-tl-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: rgba(34, 47, 92, .10);
}

.pfv-tl-dot {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(34, 47, 92, .12);
  cursor: pointer;
}

.pfv-tl-today {
  position: absolute;
  top: -10px;
  bottom: -10px;
  width: 2px;
  background: var(--gp-orange);
  z-index: 2;
}

.pfv-tl-today::before {
  content: 'HOY';
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8.5px;
  font-weight: 800;
  color: var(--gp-orange);
  white-space: nowrap;
}

.pfv-tl-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.pfv-tl-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.pfv-tl-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── Timeline v2: barra + checkmark/ring (solo entrega sustancial + primera renta) ── */
.pfv-tl-bar {
  position: absolute;
  top: 50%;
  left: 0;
  height: 4px;
  border-radius: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #a9c6f5, var(--gp-navy, rgb(34,47,92)));
  opacity: .6;
}

.pfv-tl-dot2 {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(34,47,92,.15);
  cursor: pointer;
}

.pfv-tl-dot-tip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gp-navy, rgb(34,47,92));
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 7px;
  white-space: nowrap;
  display: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.pfv-tl-dot-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gp-navy, rgb(34,47,92));
}

.pfv-tl-dot2:hover .pfv-tl-dot-tip {
  display: block;
}

.pfv-tl-today {
  position: absolute;
  top: -14px;
  bottom: 0;
  border-left: 2px dashed var(--gp-orange);
  z-index: 1;
}

.pfv-tl-today::before {
  content: 'HOY';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8.5px;
  font-weight: 800;
  color: var(--gp-orange);
  white-space: nowrap;
}

.pfv-tl-today::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gp-orange);
}

.pfv-tl-today-nolabel::before,
.pfv-tl-today-nolabel::after {
  content: none;
}

/* ── Grid inferior: timeline (más ancha) + mapa ── */
.pfv-bottom-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-top: 1.5rem;
}

.pfv-bottom-grid .section-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.pfv-map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.pfv-map-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-pfv-pop {
  font-family: 'Jost', sans-serif;
  min-width: 170px;
}

.map-pfv-pop-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.map-pfv-pop-row {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

@media (max-width: 1100px) {
  .pfv-bottom-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   FIX MOBILE (≤640px) — header compacto + KPIs 2 columnas
   Se agrega al final para ganar la cascada sobre los breakpoints
   de 900px/560px definidos arriba, que revertían estos valores.
   ============================================================ */
@media (max-width: 640px) {

  /* Header shell (index.html): se quita saludo/resumen, buscador y
     campana — solo queda el avatar del usuario + cerrar sesión */
  .header {
    padding: 10px 14px;
    justify-content: flex-end;
  }
  .pfv-greeting-row,
  .pfv-search,
  .pfv-bell {
    display: none;
  }
  .pfv-header-right {
    justify-content: space-between;
  }
  .pfv-avatar { width: 30px; height: 30px; font-size: 12px; }
  .user-area { border-left: none; padding-left: 0; gap: 8px; }
  .user-name, .user-role { display: none; }
  .logout-button { padding: 5px 8px; font-size: 10px; border-radius: 6px; }

  /* Contenido de cada iframe (.main): con el header de una sola
     fila ahora, basta con menos padding-top */
  .main { padding-top: 66px; }

  /* Reafirma 2 columnas para las KPI cards del N1 (el breakpoint
     de 560px definido arriba las regresaba a 1 columna) */
  .metrics { grid-template-columns: 1fr 1fr; }

  /* Cards de proyecto (N1): refuerzo para que siempre ocupen el
     100% del ancho disponible en mobile, una por fila */
  body .cards-grid { grid-template-columns: 1fr; width: 100%; }
  body .proj-card { width: 100%; }

  /* Paneles N2 "inline" (construcción, preconstrucción, operación):
     en vez de aplastarse lado a lado, se apilan — y al abrir el N2
     se oculta la lista/cards comprimida para que el detalle se vea
     completo en el mismo lugar */
  .inline-layout { flex-direction: column; }
  .inline-left.compressed { display: none; }
  .inline-n2 { min-width: 0; width: 100%; }
}

/* ── COMENTARIOS CON FORMATO (registrar nuevo corte) ─────────────────────── */
.nco-rte-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.nco-rte-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: #555;
  cursor: pointer;
}
.nco-rte-btn:hover { background: #f5f5f5; border-color: #ccc; }
.nco-rte-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 68px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
}
.nco-rte-input:focus { border-color: rgb(34, 47, 92); }
.nco-rte-input:empty:before {
  content: attr(data-placeholder);
  color: #999;
}
.nco-rte-input ul, .nco-rte-input ol {
  margin: 4px 0 4px 20px;
  padding: 0;
}
.nco-rte-input li { margin-bottom: 2px; }

/* ── GRADUACION: Solicitud de inicio de construccion (Etapa 1), mismas clases y colores del diseno de referencia ── */
#grad-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9500;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 16px;
  box-sizing: border-box;
}
.grad-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, .55);
}
.grad-box {
  position: relative;
  width: min(900px, 96vw);
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.grad-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #4b5565;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  z-index: 2;
}
.grad-close-btn:hover { background: #f2f3f7; }
.grad-breadcrumb { font-size: 12px; color: #8A94A6; font-weight: 600; }
.grad-hero {
  background: linear-gradient(90deg, rgb(34,47,92), #32417A);
  border-radius: 18px; padding: 22px 24px; box-shadow: 0 10px 30px rgba(34,47,92,.18);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.grad-hero-title { font-size: 20px; font-weight: 700; color: #fff; }
.grad-hero-sub { font-size: 12px; color: rgba(255,255,255,.65); margin-top: 3px; }
.grad-hero-badge { font-size: 11px; font-weight: 700; color: #fff; background: rgba(238,103,35,.92); border-radius: 20px; padding: 6px 14px; white-space: nowrap; }
.grad-steps-card { background: rgba(255,255,255,.94); border-radius: 18px; padding: 20px 24px; box-shadow: 0 10px 30px rgba(34,47,92,.08); }
.grad-steps-row { display: flex; align-items: flex-start; }
.grad-step-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; box-sizing: border-box; }
.grad-step-label { font-size: 10.5px; text-align: center; line-height: 1.3; }
.grad-step-connector { height: 2px; flex-grow: 1; margin-top: 15px; border-radius: 2px; }
.grad-panel { background: rgba(255,255,255,.94); border-radius: 18px; padding: 24px; box-shadow: 0 10px 30px rgba(34,47,92,.08); }
.grad-panel-title { font-size: 15px; font-weight: 700; color: #172033; margin-bottom: 2px; }
.grad-panel-desc { font-size: 12px; color: #8A94A6; margin-bottom: 18px; }

/* clases del diseno original, sin cambios */
.gp-btn { cursor: pointer; border: none; font-family: inherit; transition: opacity .15s, transform .1s; }
.gp-btn:hover { opacity: .88; }
.gp-btn:active { transform: scale(.98); }
.gp-btn[disabled] { cursor: not-allowed; opacity: .4; }
.gp-input { font-family: inherit; box-sizing: border-box; border-radius: 7px; border: 1.5px solid rgba(34,47,92,.15); padding: 7px 9px; font-size: 12px; color: #172033; }
.gp-input:focus { outline: none; border-color: rgb(34,47,92); }
.gp-input[type="date"] { font-weight: 600; cursor: pointer; }
.gp-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(20%) sepia(28%) saturate(1200%) hue-rotate(190deg); opacity: .6; cursor: pointer; }
.gp-input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.presup-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.presup-tbl thead { position: sticky; top: 0; z-index: 3; box-shadow: 0 3px 8px rgba(0,0,0,.08); }
.presup-tbl th { text-align: right; font-size: 9.5px; color: #999; text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 1.5px solid rgba(34,47,92,.14); position: sticky; top: 0; background: #fff; z-index: 3; }
.presup-tbl th:first-child, .presup-tbl td:first-child { text-align: left; }
.presup-tbl td { padding: 5px 8px; text-align: right; border-bottom: 1px solid #dde1ea; height: 34px; box-sizing: border-box; vertical-align: middle; }
.presup-tbl .gp-input { padding: 4px 9px; }
.presup-tbl tbody tr:hover td { background: rgba(34,47,92,.035); }
.presup-tbl tr.grp-total-row td { background: rgba(238,103,35,.12); font-weight: 700; color: rgb(180,70,20); font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; }
.presup-tbl tr.grp-cuenta-row td { background: rgba(34,47,92,.05); font-weight: 700; font-size: 10.5px; }
.presup-tbl tr.grp-total td { background: rgb(34,47,92); color: #fff; font-weight: 700; }
.presup-tbl tfoot.congelado { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -3px 8px rgba(0,0,0,.1); }
.presup-tbl tr.nivel1-row td { background: rgba(34,47,92,.055); font-weight: 700; font-size: 10.5px; }
.presup-tbl input[type="text"] { width: 84px; text-align: right; }
.doc-pill-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: #fafafa; flex-wrap: wrap; gap: 8px; }

/* Tooltip de los marcadores de "salto" en la Curva S de Graduacion a
   Construccion (preconstruccion_v2.html), en vez del title nativo del
   navegador. */
.gp-cs-marker { position: absolute; cursor: default; z-index: 15; }
.gp-cs-tooltip {
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) translateY(4px);
  background: rgb(238,103,35); color: #fff; font-size: 10px; font-weight: 600;
  padding: 5px 9px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 8px 20px rgba(238,103,35,.3); z-index: 20;
}
.gp-cs-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgb(238,103,35);
}
.gp-cs-marker:hover .gp-cs-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }
