/* =====================================================================
   Resumen Ejecutivo · Manual de Identidad Corporativa Grupo Grafix 2026
   Colores: Azul oscuro #012A54 · Azul #055BA6 · Verde #19A603 ·
            Naranja #F27507 · Rojo #F20505
   Tipografía: Poppins (titulares) · Montserrat (textos)
   ===================================================================== */
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/poppins-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }

:root {
  --gfx-marino: #012A54;
  --gfx-azul: #055BA6;
  --gfx-verde: #19A603;
  --gfx-naranja: #F27507;
  --gfx-rojo: #F20505;
  --gfx-gris-azul: #B7C7DC;       /* tono claro de los numerales y subtítulos del manual */
  --gfx-fondo: #F3F6FA;
  --gfx-linea: #DFE6EF;
  --gfx-texto: #14243A;
  --gfx-suave: #52627A;
  --gfx-titulo: "Poppins", "Montserrat", Arial, sans-serif;
  --gfx-cuerpo: "Montserrat", Arial, Helvetica, sans-serif;
}

.re-main {
  font-family: var(--gfx-cuerpo);
  color: var(--gfx-texto);
  background: var(--gfx-fondo);
  padding: 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}
.re-main > *:not(.re-hero):not(.re-pie) { margin-left: 36px; margin-right: 36px; }

/* ---------- Encabezado con onda corporativa ---------- */
.re-hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 34px 36px 26px;
  background-color: #FFFFFF;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 220' preserveAspectRatio='none'%3E%3Cpath d='M120 0 C 260 40 300 150 470 120 C 540 108 580 150 600 220 L600 0 Z' fill='%23012A54'/%3E%3Cpath d='M300 0 C 390 30 420 80 520 70 C 560 66 590 80 600 100 L600 0 Z' fill='%23055BA6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right top;
  background-size: min(52%, 640px) 100%;
  border-bottom: 1px solid var(--gfx-linea);
  overflow: hidden;
}
.re-hero-texto { display: flex; align-items: flex-start; gap: 18px; position: relative; z-index: 1; }
.re-numero {
  font-family: var(--gfx-titulo);
  font-weight: 700;
  font-size: 68px;
  line-height: .9;
  color: #D6E0EC;
  letter-spacing: -2px;
}
.re-hero h1 {
  margin: 4px 0 0;
  font-family: var(--gfx-titulo);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  color: var(--gfx-marino);
}
.re-subtitulo {
  margin: 0;
  font-family: var(--gfx-titulo);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.1;
  color: var(--gfx-gris-azul);
}
.re-bajada { margin: 10px 0 0; font-size: 13px; color: var(--gfx-suave); }
.re-usuario {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  background: rgba(1, 42, 84, .55);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 20px;
  padding: 6px 14px;
}

/* ---------- Filtros ---------- */
.re-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: #FFFFFF;
  border: 1px solid var(--gfx-linea);
  border-radius: 14px;
  padding: 14px 16px;
}
.re-filtros label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 150px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gfx-azul);
  margin: 0;
}
.re-filtros input, .re-filtros select {
  height: 40px;
  border: 1px solid #CCD7E4;
  border-radius: 8px;
  padding: 0 10px;
  font-family: var(--gfx-cuerpo);
  font-size: 14px;
  color: var(--gfx-texto);
  background: #FFFFFF;
  text-transform: none;
  letter-spacing: 0;
}
.re-filtros input:focus, .re-filtros select:focus { outline: 2px solid #9CC0E6; outline-offset: 1px; border-color: var(--gfx-azul); }
.re-botones { display: flex; gap: 8px; }
.re-btn {
  height: 40px;
  border-radius: 20px;
  padding: 0 18px;
  font-family: var(--gfx-titulo);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.re-btn svg { width: 16px; height: 16px; }
.re-btn-pri { background: var(--gfx-marino); color: #FFFFFF; border: 0; }
.re-btn-pri:hover { background: var(--gfx-azul); }
.re-btn-sec { background: #FFFFFF; color: var(--gfx-marino); border: 1.5px solid var(--gfx-marino); }
.re-btn-sec:hover { background: #EEF3F9; }

.notice { font-size: 13px; color: var(--gfx-suave); }
.notice:empty { display: none; }
.notice.error { background: #FDECEC; color: #A40303; border-radius: 10px; padding: 10px 14px; }

/* ---------- Tarjetas de indicadores ---------- */
.re-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.re-kpi {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--gfx-linea);
  border-radius: 14px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.re-kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--kpi, var(--gfx-azul)); }
.re-kpi.azul { --kpi: var(--gfx-azul); }
.re-kpi.verde { --kpi: var(--gfx-verde); }
.re-kpi.marino { --kpi: var(--gfx-marino); }
.re-kpi.naranja { --kpi: var(--gfx-naranja); }
.re-kpi.rojo { --kpi: var(--gfx-rojo); }
.re-kpi-top { display: flex; align-items: center; gap: 10px; }
.re-kpi-top b { font-family: var(--gfx-titulo); font-weight: 600; font-size: 13px; color: var(--gfx-marino); line-height: 1.25; }
.re-ico {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  background: var(--kpi, var(--gfx-azul));
}
.re-ico svg { width: 18px; height: 18px; }
.re-kpi strong {
  font-family: var(--gfx-titulo);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  color: var(--gfx-marino);
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.re-kpi small { font-size: 11.5px; color: var(--gfx-suave); line-height: 1.35; }

/* ---------- Paneles ---------- */
.re-fila { display: grid; gap: 16px; }
.re-fila-principal { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.re-fila-dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.re-fila-tres { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr); }
.re-panel {
  background: #FFFFFF;
  border: 1px solid var(--gfx-linea);
  border-radius: 14px;
  padding: 18px 20px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.re-panel h2 {
  margin: 0;
  font-family: var(--gfx-titulo);
  font-weight: 600;
  font-size: 16px;
  color: var(--gfx-marino);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 4px solid var(--gfx-azul);
  line-height: 1.2;
}
.re-ico-h { display: inline-flex; color: var(--gfx-azul); }
.re-ico-h svg { width: 18px; height: 18px; }
.re-chart { position: relative; height: 240px; }
.re-chart.alto { height: 300px; }

/* ---------- Incumplimientos ---------- */
.re-alertas { display: flex; flex-direction: column; gap: 8px; }
.re-alertas > div {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}
.re-alertas svg { width: 18px; height: 18px; flex: none; }
.re-alertas b { margin-left: auto; font-family: var(--gfx-titulo); font-size: 20px; }
.re-alertas .rojo { background: #FEECEC; color: #A40303; }
.re-alertas .naranja { background: #FFF1E3; color: #9A4600; }
.re-alertas .marino { background: #E8EEF6; color: var(--gfx-marino); }
.re-nota { margin: 0; font-size: 11.5px; color: var(--gfx-suave); line-height: 1.4; }

/* ---------- Tablas ---------- */
.re-tabla { overflow: auto; max-height: 260px; }
.re-tabla table { width: 100%; border-collapse: collapse; font-size: 13px; }
.re-tabla th {
  text-align: left;
  font-family: var(--gfx-titulo);
  font-weight: 600;
  font-size: 12px;
  color: #FFFFFF;
  background: var(--gfx-marino);
  padding: 9px 10px;
  position: sticky;
  top: 0;
}
.re-tabla th:first-child { border-top-left-radius: 8px; }
.re-tabla th:last-child { border-top-right-radius: 8px; }
.re-tabla td { padding: 9px 10px; border-bottom: 1px solid #EDF1F6; }
.re-tabla tbody tr:nth-child(even) td { background: #F8FAFD; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 12px; }
.pill.bad { background: #FEECEC; color: #A40303; }

/* ---------- Pie con onda ---------- */
.re-pie {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 30px 36px 18px;
  font-size: 12px;
  color: #DCE6F3;
  background-color: var(--gfx-marino);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H1200 V8 C 900 40 600 0 300 22 C 180 31 80 28 0 18 Z' fill='%23F3F6FA'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 22px;
}
.re-pie b { color: #FFFFFF; font-family: var(--gfx-titulo); font-weight: 600; }

/* ---------- Pantallas medianas y pequeñas ---------- */
@media (max-width: 1280px) {
  .re-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .re-fila-tres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .re-fila-principal, .re-fila-dos, .re-fila-tres { grid-template-columns: minmax(0, 1fr); }
  .re-hero { background-size: 40% 70px; }
}
@media (max-width: 640px) {
  .re-main > *:not(.re-hero):not(.re-pie) { margin-left: 14px; margin-right: 14px; }
  .re-hero { padding: 22px 16px 18px; background-size: 34% 44px; }
  .re-numero { font-size: 46px; }
  .re-hero h1 { font-size: 26px; }
  .re-subtitulo { font-size: 20px; }
  .re-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .re-kpi strong { font-size: 28px; }
}
@media print {
  .re-filtros .re-botones { display: none; }
  .re-main { background: #FFFFFF; }
}
