/* ============================================================
   PORTAL EJECUTIVO DE GESTIÓN — SISTEMA DE DISEÑO
   Paleta: ink navy + teal (impacto) + coral (prioridad)
   Tipografía: Inter (UI) + IBM Plex Mono (datos/KPIs)
   ============================================================ */

:root {
  /* Color — estética GIGA: sidebar rojo institucional, negro como color de acción, rojo como énfasis puntual */
  --ink: #1A1A1A;
  --ink-soft: #46464A;
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-sunken: #EFF0F2;
  --border: #E4E5E8;
  --border-strong: #D2D3D7;

  --accent: #1C1C1E;        /* negro/carbón — color de acción: links, botones, activos en contenido */
  --accent-soft: #EDEDEF;
  --teal: #3A3A3C;          /* gris oscuro — estado "Finalizada" (neutro, completado) */
  --teal-soft: #ECECED;
  --amber: #7A7A80;         /* gris medio — estado "En curso" / prioridad media */
  --amber-soft: #F0F0F1;
  --coral: #A82C30;         /* rojo institucional — énfasis puntual: entrega, impacto, prioridad alta */
  --coral-soft: #F7E3E3;
  --slate: #6B6B70;
  --slate-soft: #EDEDEF;

  --brand-red: #A82C30;         /* rojo de marca — sidebar */
  --brand-red-active: #1C1C1E;  /* pastilla activa dentro del sidebar */

  /* Colores de estado (extraídos de GIGA) */
  --green: #197B53;
  --green-soft: #E2F5EE;
  --blue: #246178;
  --blue-soft: #E3F4F8;
  --gray-status: #617086;
  --gray-status-soft: #DFE8F1;
  --yellow: #B7791F;
  --yellow-soft: #FDF3DC;

  /* Colores de gráficos — predeterminados, independientes de la paleta de marca */
  --chart-blue: #3B82F6;
  --chart-gray: #94A3B8;
  --chart-amber: #F59E0B;

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

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

  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.05), 0 1px 1px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.07), 0 1px 3px rgba(26, 26, 26, 0.05);
  --shadow-lg: 0 12px 32px rgba(26, 26, 26, 0.12), 0 2px 6px rgba(26, 26, 26, 0.06);

  --sidebar-w: 240px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--coral); text-decoration: underline; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* Focus visibility */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   LAYOUT
   ============================================================ */

#app {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--brand-red);
  color: #F5DADA;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 20;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.sidebar-brand .org {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-brand .sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.78);
  margin-top: 3px;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.8);
  font-size: 13.5px;
  font-weight: 500;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.9; }

.nav-item:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }

.nav-item.active {
  background: var(--brand-red-active);
  color: #fff;
}
.nav-item.active svg { opacity: 1; color: #fff; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.18);
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}

/* --- Main column --- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.breadcrumb {
  font-size: 13px;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb b { color: var(--ink); font-weight: 600; }
.breadcrumb .sep { color: var(--border-strong); }

.period-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-picker label {
  font-size: 12px;
  color: var(--slate);
  font-weight: 500;
}

.period-select {
  appearance: none;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-ui);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%23667085' stroke-width='1.5' fill='none' fill-rule='evenodd'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.period-select:disabled { opacity: 1; cursor: not-allowed; }

.view-root {
  padding: 28px 32px 56px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

.page-head {
  margin-bottom: 22px;
}
.page-head .eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 6px;
}
.page-head h1 { font-size: 24px; margin-bottom: 6px; }
.page-head .desc { color: var(--slate); font-size: 14px; max-width: 720px; }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi-card .kpi-label {
  font-size: 12px;
  color: var(--slate);
  font-weight: 500;
  margin-bottom: 8px;
}
.kpi-card .kpi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.kpi-card .kpi-value .suffix { font-size: 14px; color: var(--slate); margin-left: 2px; }

/* Section */
.section { margin-bottom: 32px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 16px; }
.section-head .link-all { font-size: 13px; font-weight: 600; }

/* Logros list */
.logros-list { display: flex; flex-direction: column; gap: 10px; }
.logro-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
}
.logro-item .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); margin-top: 6px; flex-shrink: 0;
}
.logro-item p { font-size: 13.5px; color: var(--ink-soft); }

/* Cards grid (iniciativas) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .cards-grid { grid-template-columns: 1fr; } }

.ini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ini-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.ini-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.ini-card-code { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }
.ini-card h3 { font-size: 15px; line-height: 1.35; margin-top: 4px; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 100px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge-finalizada { background: var(--green-soft); color: var(--green); }
.badge-entrega { background: var(--blue-soft); color: var(--blue); }
.badge-en-curso { background: var(--gray-status-soft); color: var(--gray-status); }

.ini-card-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.ini-stat { display: flex; flex-direction: column; gap: 2px; }
.ini-stat .n { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ini-stat .l { font-size: 10.5px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.04em; }

.ini-card-impact {
  font-size: 12.5px;
  color: var(--green);
  font-weight: 600;
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.ini-card-frentes { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate);
  background: var(--slate-soft);
  padding: 3px 9px;
  border-radius: 100px;
}

/* Filters bar */
.filters-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
}
.filter-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 18px;
}
.back-link:hover { color: var(--ink); text-decoration: none; }
.back-link svg { width: 14px; height: 14px; }

/* Detail page */
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 8px;
}
.detail-head .titles { flex: 1; }
.detail-head .code {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 12px; color: var(--slate);
  margin-bottom: 6px; font-weight: 600;
}
.detail-head .code:hover { color: var(--coral); text-decoration: none; }
.detail-head .code svg { width: 11px; height: 11px; }
.detail-head h1 { font-size: 22px; }

.detail-meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 18px 0 26px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.detail-meta-item { display: flex; flex-direction: column; gap: 3px; }
.detail-meta-item .l { font-size: 11px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-meta-item .v { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--ink); }

.detail-block { margin-bottom: 28px; }
.detail-block h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
  margin-bottom: 12px;
  font-weight: 700;
}
.detail-block .resumen-text { font-size: 15px; color: var(--ink-soft); max-width: 760px; }

.check-list { display: flex; flex-direction: column; gap: 9px; max-width: 760px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; }
.check-item svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--teal); }
.check-item p { font-size: 13.5px; color: var(--ink-soft); }

.indicadores-row { display: flex; gap: 12px; flex-wrap: wrap; }
.indicador-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 150px;
}
.indicador-pill .v { font-family: var(--font-mono); font-size: 18px; font-weight: 650; color: var(--ink); }
.indicador-pill .l { font-size: 11.5px; color: var(--slate); margin-top: 3px; }

.entregables-list { display: flex; flex-direction: column; gap: 8px; }
.entregable-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 15px;
}
.entregable-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface-sunken);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--slate);
}
.entregable-icon svg { width: 16px; height: 16px; }
.entregable-body { flex: 1; min-width: 0; }
.entregable-body .name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.entregable-body .desc { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.entregable-tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--slate); background: var(--slate-soft); padding: 3px 8px; border-radius: 100px;
  flex-shrink: 0;
}
.entregable-link {
  font-size: 12.5px; font-weight: 600; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.entregable-link svg { width: 13px; height: 13px; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.data-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--slate); font-weight: 700; padding: 11px 14px; background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--ink-soft); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.total-row td { font-weight: 700; color: var(--ink); background: var(--surface-sunken); }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Indicadores view charts */
.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-size: 14px; margin-bottom: 4px; }
.chart-card .chart-sub { font-size: 12.5px; color: var(--slate); margin-bottom: 16px; }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-row .bar-label { width: 220px; flex-shrink: 0; font-size: 12.5px; color: var(--ink-soft); }
.bar-track { flex: 1; height: 20px; background: var(--surface-sunken); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; }
.bar-row .bar-value { width: 70px; text-align: right; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; flex-shrink: 0; }

.stack-bar-wrap { display: flex; align-items: flex-end; gap: 18px; height: 180px; padding-top: 10px; }
.stack-col { flex: 1; display: flex; flex-direction: column-reverse; align-items: stretch; height: 100%; position: relative; }
.stack-seg { width: 100%; border-radius: 3px 3px 0 0; }
.stack-col .month-label { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--slate); }

.legend-row { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }

/* Frentes grid */
.frentes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1000px) { .frentes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .frentes-grid { grid-template-columns: 1fr; } }

.frente-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.frente-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.frente-card h3 { font-size: 15px; }
.frente-card p { font-size: 12.5px; color: var(--slate); line-height: 1.5; }
.frente-card .count { font-family: var(--font-mono); font-size: 12px; color: var(--coral); font-weight: 600; }

.equipo-table { margin-top: 8px; }

/* Próximos pasos */
.prioridad-group { margin-bottom: 26px; }
.prioridad-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.prioridad-dot { width: 9px; height: 9px; border-radius: 50%; }

.pasos-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.pasos-card.alta { border-left-color: var(--coral); }
.pasos-card.media { border-left-color: var(--yellow); }
.pasos-card.normal { border-left-color: var(--green); }

.pasos-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.pasos-card h3 { font-size: 14.5px; }
.pasos-card .impacto-tag { font-size: 11.5px; color: var(--teal); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.pasos-card .descripcion { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.pasos-card .meta-text { font-size: 13px; color: var(--ink); font-weight: 600; margin-bottom: 10px; background: var(--surface-sunken); padding: 8px 12px; border-radius: 6px; }
.pasos-card .acciones { display: flex; flex-direction: column; gap: 6px; }
.pasos-card .accion-item { display: flex; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.pasos-card .accion-item .bullet { color: var(--slate); flex-shrink: 0; }

/* Mobile nav toggle */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    height: 56px; padding: 0 16px; background: var(--brand-red); position: sticky; top: 0; z-index: 15;
  }
  .mobile-topbar button { background: none; border: none; color: #fff; }
  .mobile-topbar .org { color: #fff; font-weight: 700; font-size: 14px; }
  .sidebar-overlay.open {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 19;
  }
  .topbar { padding: 0 16px; }
  .view-root { padding: 20px 16px 48px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .detail-meta-row { gap: 16px; }
  .stack-bar-wrap { gap: 8px; }
  .bar-row .bar-label { width: 130px; font-size: 11.5px; }
}

/* ============================================================
   DESCARGA DE INFORME (PDF)
   ============================================================ */

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.download-wrap { position: relative; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-sunken); border-color: var(--border-strong); color: var(--ink); }
.icon-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.download-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 30;
}
.download-menu.open { display: block; }

.download-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
}
.download-menu-item:hover { background: var(--surface-sunken); }
.download-menu-item .dmi-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.download-menu-item .dmi-desc { font-size: 11.5px; color: var(--slate); }

.print-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 16, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.print-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 22px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.print-modal-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.print-modal-icon svg { width: 20px; height: 20px; }
.print-modal h3 { font-size: 16px; margin-bottom: 10px; }
.print-modal p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.print-modal p b { color: var(--ink); font-weight: 700; }

.print-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.print-modal-actions button {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid transparent;
}
.btn-secondary { background: var(--surface); border-color: var(--border-strong) !important; color: var(--ink-soft); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }

/* ============================================================
   ESTADOS DE CARGA / ERROR AL CAMBIAR DE PERÍODO
   ============================================================ */

.period-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 90px 20px;
  color: var(--slate);
}
.period-loading .spinner {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--ink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.period-loading p { font-size: 13.5px; }

.period-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 80px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.period-error .icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--coral-soft); color: var(--coral);
  display: flex; align-items: center; justify-content: center;
}
.period-error .icon svg { width: 20px; height: 20px; }
.period-error h3 { font-size: 15px; }
.period-error p { font-size: 13px; color: var(--slate); line-height: 1.55; }
.period-error code {
  background: var(--surface-sunken); padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 11.5px;
}

/* ============================================================
   VISTA DE IMPRESIÓN / PDF
   ============================================================ */

#print-root { display: none; }

.print-cover {
  text-align: center;
  padding-top: 140px;
}
.print-cover .print-cover-eyebrow {
  color: var(--coral);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
.print-cover h1 { font-size: 30px; margin: 12px 0 8px; }
.print-cover p { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.print-cover .print-cover-meta, .print-cover .print-cover-date { color: var(--slate); font-size: 12.5px; }

.print-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--coral);
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

@media print {
  #app { display: none !important; }
  body.is-printing #print-root { display: block !important; }

  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }

  @page { margin: 16mm 14mm; }

  body { background: #fff; font-size: 12px; }

  .print-page-break { page-break-before: always; break-before: page; }
  .print-cover { page-break-after: always; break-after: page; }

  .kpi-card, .indicador-pill, .pasos-card, .entregable-row, .chart-card,
  .ini-card, .frente-card, .logro-item { break-inside: avoid; }

  .ini-card:hover, .frente-card:hover { transform: none; box-shadow: var(--shadow-sm); }

  a[href]::after { content: ""; }
  .back-link, .filters-bar, .link-all, .section-head .link-all { display: none !important; }
  .print-modal-overlay { display: none !important; }
}

