/* =========================================================
   BASE GENERAL
========================================================= */

:root {
  --bg: #f0f4f9;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-solid: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: rgba(11, 45, 79, 0.1);

  --navy: #0b2d4f;
  --navy-mid: #1e293b;
  --navy-soft: #1a3d5c;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.22);

  /* Alias (usado por componentes antiguos) */
  --blue: var(--accent);

  --aprobado: #16a34a;
  --desaprobado: #0891b2;
  --proceso: #d97706;
  --no-inicio: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(11, 45, 79, 0.12), transparent 50%),
    radial-gradient(
      ellipse at 100% 100%,
      rgba(59, 130, 246, 0.08),
      transparent 50%
    ),
    linear-gradient(160deg, #e8eef7 0%, #f0f4f9 50%, #eaf0f8 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fondo dedicado para pagina de inicio (se asemeja al mock) */
body.inicio-page {
  background: #071a34;
}

.page {
  width: 100%;
  min-height: 100vh;
  padding: 20px 24px;
}

.app-shell {
  max-width: 1700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hidden {
  display: none !important;
}

/* =========================================================
   TOPBAR — Hero banner
========================================================= */

.topbar {
  margin: 0;
}

.brand-block {
  position: relative;
  padding: 28px 36px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(
    130deg,
    var(--navy) 0%,
    var(--navy-mid) 60%,
    #0f2540 100%
  );
  box-shadow:
    0 24px 60px rgba(11, 45, 79, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Grid de líneas sutiles */
.brand-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Orbe de luz */
.brand-orb {
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.28) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 1;
}

.brand-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.eyebrow-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.header-title {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(17px, 2.2vw, 30px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 1200px;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 500;
}

.meta-link {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  opacity: 0.9;
}

.meta-link:hover {
  opacity: 1;
}

.meta-link:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.22);
  outline-offset: 3px;
  border-radius: 8px;
}

.header-meta strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}
.header-meta span {
  color: rgba(255, 255, 255, 0.72);
}

.meta-sep {
  color: rgba(255, 255, 255, 0.3);
  font-size: 16px;
  line-height: 1;
}

.ids-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
}

/* Indicador de refresh dentro del header */
.refresh-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  color: rgba(200, 230, 255, 0.95);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.refresh-indicator .spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Eliminamos status-card (no se usa) ── */
.status-card,
.status-label,
.dot-separator,
.eyebrow {
  display: none;
}

/* =========================================================
   TABS — Barra de navegación
========================================================= */

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 7px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(11, 45, 79, 0.1);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(11, 45, 79, 0.08);
}

/* Mientras no se elija curso, bloquea navegacion */
.curso-pendiente .tabs {
  opacity: 0.55;
  pointer-events: none;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  min-height: 48px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab svg {
  opacity: 0.65;
  transition: opacity 0.18s;
  flex-shrink: 0;
}

.tab:hover {
  color: var(--navy);
  background: rgba(11, 45, 79, 0.06);
}
.tab:hover svg {
  opacity: 1;
}

.tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  box-shadow: 0 6px 20px rgba(11, 45, 79, 0.28);
}
.tab.active svg {
  opacity: 1;
}

/* =========================================================
   PANELES GENERALES
========================================================= */

.filters-panel,
.kpi-panel,
.content-panel {
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid rgba(11, 45, 79, 0.09);
  box-shadow: 0 4px 24px rgba(11, 45, 79, 0.07);
  backdrop-filter: blur(12px);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.78);
}

.meta-chip strong {
  color: rgba(255, 255, 255, 0.95);
}

.meta-chip.ok {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.3);
  color: rgba(214, 255, 231, 0.95);
}

.meta-chip.warn {
  background: rgba(217, 119, 6, 0.16);
  border-color: rgba(217, 119, 6, 0.3);
  color: rgba(255, 236, 210, 0.95);
}

/* KPI panel con fondo mas limpio */
.kpi-panel {
  background:
    radial-gradient(
      1200px 180px at 0% 0%,
      rgba(59, 130, 246, 0.1),
      transparent 60%
    ),
    radial-gradient(
      900px 160px at 100% 0%,
      rgba(11, 45, 79, 0.1),
      transparent 55%
    ),
    var(--panel);
}

.filters-panel,
.kpi-panel {
  padding: 18px 20px;
}

.content-panel {
  padding: 0;
  overflow: hidden;
}

.section-title,
.kpi-panel-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  margin-bottom: 14px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(11, 45, 79, 0.08);
  background: linear-gradient(
    180deg,
    rgba(11, 45, 79, 0.04) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.content-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.content-kicker {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.content-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.soft-title {
  margin-bottom: 4px;
}

.view-badge {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(11, 45, 79, 0.08);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 1px solid rgba(11, 45, 79, 0.12);
}

/* ── Eliminar refresh-indicator duplicado ── */

#contenidoVista {
  padding: 20px 24px;
  animation: rise-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   FILTROS
========================================================= */

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 900;
  color: #4b5563;
  margin-bottom: 5px;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 13px;
  background: #ffffff;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}

.kpi-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(11, 45, 79, 0.08);
  box-shadow: 0 2px 12px rgba(11, 45, 79, 0.05);
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 45, 79, 0.1);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--navy), var(--accent));
  border-radius: 4px 0 0 4px;
}

/* KPI panel estandarizado: colores por estado */
.kpi-card.aprobado::before {
  background: linear-gradient(
    180deg,
    var(--aprobado),
    color-mix(in srgb, var(--aprobado) 40%, white)
  );
}
.kpi-card.desaprobado::before {
  background: linear-gradient(
    180deg,
    var(--desaprobado),
    color-mix(in srgb, var(--desaprobado) 40%, white)
  );
}
.kpi-card.proceso::before {
  background: linear-gradient(
    180deg,
    var(--proceso),
    color-mix(in srgb, var(--proceso) 40%, white)
  );
}
.kpi-card.no-inicio::before {
  background: linear-gradient(
    180deg,
    var(--no-inicio),
    color-mix(in srgb, var(--no-inicio) 40%, white)
  );
}

.kpi-card.total {
  background: linear-gradient(135deg, #0b2d4f, #123d68);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.kpi-card.total::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(139, 232, 255, 0.9)
  );
}

.kpi-card.total .kpi-label,
.kpi-card.total .kpi-value,
.kpi-card.total .kpi-note {
  color: #ffffff;
}

.kpi-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.kpi-value {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.04em;
}

.kpi-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* =========================================================
   MENSAJES
========================================================= */

.message {
  padding: 12px 16px;
  border-radius: 10px;
  margin: 14px 20px 0;
  font-size: 13px;
  font-weight: 600;
}

.message.loading {
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.message.error {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #b91c1c;
}

.message.success {
  background: rgba(22, 163, 74, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: #15803d;
}

.placeholder {
  min-height: 200px;
  display: grid;
  place-items: center;
  padding: 32px;
  border-radius: 14px;
  background: rgba(11, 45, 79, 0.03);
  border: 1.5px dashed rgba(11, 45, 79, 0.14);
  color: var(--muted);
  text-align: center;
  font-weight: 500;
  font-size: 14px;
}

/* Loader local (ej: matriz por cargo en Resumen) */
.matrix-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 22px 16px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.12);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.matrix-loader svg {
  color: #1d4ed8;
}

/* =========================================================
   TABLAS GENERALES
========================================================= */

.table-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.table-info span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(11, 45, 79, 0.05);
  border: 1px solid rgba(11, 45, 79, 0.08);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

/* =========================================================
   Selector de curso (pantalla inicial)
========================================================= */

.inicio-layout {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-items: center;
  padding: 56px 20px 42px;
  overflow: hidden;
}

.inicio-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      1200px 700px at 20% 10%,
      rgba(59, 130, 246, 0.55),
      rgba(7, 31, 63, 0) 55%
    ),
    radial-gradient(
      1100px 700px at 80% 0%,
      rgba(59, 130, 246, 0.55),
      rgba(7, 31, 63, 0) 58%
    ),
    linear-gradient(180deg, #0b2d4f 0%, #071f3f 55%, #071a34 100%);
  filter: saturate(1.05);
}

.inicio-layout > * {
  position: relative;
  z-index: 1;
}

.inicio-hero {
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}

.inicio-kicker {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
}

.inicio-title {
  margin: 20px 0 10px;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: #ffffff;
  font-weight: 900;
}

.inicio-subtitle {
  margin: 0 auto;
  max-width: 820px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.inicio-status {
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.inicio-actions {
  margin-top: 18px;
}

.inicio-cards {
  width: 100%;
  max-width: 1280px;
  margin: 40px auto 0;
}

.inicio-groups {
  display: grid;
  gap: 26px;
}

.inicio-group {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 16px;
  backdrop-filter: blur(16px);
}

.inicio-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 14px;
}

.inicio-group-kicker {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 11px;
}

.inicio-group-title {
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 18px;
}

.inicio-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.inicio-cards-grid--ins {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .inicio-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inicio-cards-grid--ins {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .inicio-cards-grid {
    grid-template-columns: 1fr;
  }
  .inicio-cards-grid--ins {
    grid-template-columns: 1fr;
  }
  .inicio-cards {
    margin-top: 26px;
  }
  .inicio-subtitle {
    font-size: 18px;
  }
}

.inicio-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(
      800px 220px at 0% 0%,
      rgba(255, 255, 255, 0.12),
      transparent 55%
    ),
    rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  cursor: pointer;
  justify-content: center;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.inicio-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.26);
  background:
    radial-gradient(
      800px 220px at 0% 0%,
      rgba(255, 255, 255, 0.14),
      transparent 55%
    ),
    rgba(255, 255, 255, 0.1);
}

.inicio-card:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.28);
  outline-offset: 3px;
}

.inicio-card.is-active {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.18);
}

.inicio-card--inscripcion {
  border-color: rgba(59, 130, 246, 0.45);
  background:
    radial-gradient(
      800px 220px at 0% 0%,
      rgba(59, 130, 246, 0.22),
      transparent 60%
    ),
    rgba(59, 130, 246, 0.08);
}

.inicio-card--inscripcion:hover {
  border-color: rgba(59, 130, 246, 0.65);
  background:
    radial-gradient(
      800px 220px at 0% 0%,
      rgba(59, 130, 246, 0.26),
      transparent 60%
    ),
    rgba(59, 130, 246, 0.1);
}

.inicio-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  margin: 0 0 10px;
  box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.03);
}

.inicio-card-dot.soft {
  opacity: 0.72;
}

.inicio-card-dot.active {
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.03),
    0 0 0 20px rgba(255, 255, 255, 0.02);
}

.inicio-card-title {
  font-size: clamp(16px, 1.55vw, 22px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.inicio-card-sub {
  margin-top: 7px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.inicio-card-tag {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.78);
}

.inicio-footer {
  margin-top: 46px;
  text-align: center;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
}

/* =========================================================
   Acceso (login)
========================================================= */

.login-card {
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  display: grid;
  gap: 12px;
}

.login-row {
  display: grid;
  gap: 6px;
  text-align: left;
}

.login-label {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
}

.login-input {
  width: 100%;
  border-radius: 14px;
  padding: 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  outline: none;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.login-input:focus {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.login-input option {
  color: #0b2d4f;
}

.login-actions {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-top: 6px;
}

.login-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(
      800px 220px at 0% 0%,
      rgba(255, 255, 255, 0.16),
      transparent 55%
    ),
    rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  background:
    radial-gradient(
      800px 220px at 0% 0%,
      rgba(255, 255, 255, 0.18),
      transparent 55%
    ),
    rgba(255, 255, 255, 0.14);
}

/* =========================================================
   Inscripcion (carga CSV + metricas)
========================================================= */

body.inscripcion-page {
  background:
    radial-gradient(
      ellipse at 20% 0%,
      rgba(59, 130, 246, 0.16),
      transparent 55%
    ),
    radial-gradient(
      ellipse at 100% 90%,
      rgba(11, 45, 79, 0.1),
      transparent 55%
    ),
    linear-gradient(160deg, #e8eef7 0%, #f0f4f9 55%, #eaf0f8 100%);
}

.ins-layout {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 20px 46px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ins-hero {
  border-radius: 22px;
  background: linear-gradient(
    130deg,
    var(--navy) 0%,
    var(--navy-mid) 70%,
    #0f2540 100%
  );
  box-shadow: 0 24px 60px rgba(11, 45, 79, 0.22);
  padding: 22px 22px;
  color: #fff;
}

.ins-kicker {
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.ins-title {
  margin: 10px 0 8px;
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.ins-subtitle {
  margin: 0;
  max-width: 920px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.ins-actions {
  margin-top: 14px;
}

.ins-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 2px;
}

.ins-back:hover {
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.ins-link {
  color: rgba(30, 41, 59, 0.9);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.ins-link:hover {
  opacity: 0.9;
}

.ins-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 45, 79, 0.1);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(11, 45, 79, 0.07);
}

.ins-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ins-tab {
  border: 1px solid rgba(11, 45, 79, 0.12);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  padding: 12px 12px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.02em;
  color: rgba(30, 41, 59, 0.75);
}

.ins-tab.is-active {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.1);
  color: rgba(30, 41, 59, 0.95);
}

.ins-view.hidden {
  display: none !important;
}

.ins-section-title {
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.95);
  font-size: 12px;
  margin-bottom: 10px;
}

.ins-matrix-wrap {
  margin-top: 14px;
}

.ins-matrix-wrap .table-wrap {
  max-height: 520px;
  overflow: auto;
}

.ins-heatmap-wrap {
  margin-top: 12px;
  border: 1px solid rgba(11, 45, 79, 0.1);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.ins-heatmap {
  position: relative;
}

.ins-heatmap-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ins-heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ins-heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(11, 45, 79, 0.08);
  background: rgba(11, 45, 79, 0.06);
  padding: 0;
  cursor: default;
}

.ins-heatmap-cell:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.22);
  outline-offset: 2px;
}

.ins-heatmap-cell.l0 {
  background: rgba(11, 45, 79, 0.06);
}
.ins-heatmap-cell.l1 {
  background: rgba(34, 197, 94, 0.22);
}
.ins-heatmap-cell.l2 {
  background: rgba(34, 197, 94, 0.38);
}
.ins-heatmap-cell.l3 {
  background: rgba(34, 197, 94, 0.58);
}
.ins-heatmap-cell.l4 {
  background: rgba(22, 163, 74, 0.86);
  border-color: rgba(22, 163, 74, 0.65);
}

.ins-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(100, 116, 139, 0.95);
  font-size: 12px;
  font-weight: 700;
}

.ins-heatmap-legend .ins-heatmap-cell {
  cursor: default;
}

.ins-heatmap-tooltip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  background: rgba(15, 23, 42, 0.92);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

.ins-summary-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 1100px) {
  .ins-summary-grid {
    grid-template-columns: 1fr;
  }
}

.ins-summary-side {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ins-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1060px) {
  .ins-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ins-nominal-meta {
  margin: 10px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs.tabs-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ins-nominal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ins-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 860px) {
  .ins-grid {
    grid-template-columns: 1fr;
  }
}

.ins-card {
  border: 1px solid rgba(11, 45, 79, 0.1);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.ins-card-title {
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(30, 41, 59, 0.8);
}

.ins-card-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ins-input {
  width: 100%;
  border: 1px solid rgba(11, 45, 79, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.ins-input:focus {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.ins-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: rgba(59, 130, 246, 0.95);
  color: #fff;
  cursor: pointer;
}

.ins-btn.ins-btn-secondary {
  background: rgba(11, 45, 79, 0.06);
  color: rgba(11, 45, 79, 0.92);
  border: 1px solid rgba(11, 45, 79, 0.16);
}

.ins-btn.ins-btn-secondary:hover {
  background: rgba(11, 45, 79, 0.08);
}

.ins-btn:hover {
  filter: brightness(1.03);
}

.ins-help {
  font-size: 12px;
  color: rgba(100, 116, 139, 0.95);
  font-weight: 600;
  line-height: 1.35;
}

.ins-status {
  margin-top: 12px;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(11, 45, 79, 0.1);
  background: rgba(11, 45, 79, 0.03);
  color: rgba(30, 41, 59, 0.85);
  font-weight: 700;
}

.ins-status.is-error {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.06);
  color: rgba(153, 27, 27, 0.95);
}

.ins-status.is-ok {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(22, 163, 74, 0.06);
  color: rgba(20, 83, 45, 0.95);
}

.ins-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 980px) {
  .ins-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ins-metric {
  border: 1px solid rgba(11, 45, 79, 0.1);
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
}

.ins-metric-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.95);
}

.ins-metric-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(30, 41, 59, 0.92);
}

.ins-controls {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ins-label {
  font-weight: 900;
  color: rgba(30, 41, 59, 0.85);
  font-size: 13px;
}

.ins-select {
  min-width: 260px;
  border: 1px solid rgba(11, 45, 79, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.ins-chart-wrap {
  margin-top: 0;
  height: 360px;
  border: 1px solid rgba(11, 45, 79, 0.1);
  border-radius: 16px;
  background: #fff;
  padding: 15px 15px 30px 15px;
}

@media (max-width: 560px) {
  .ins-chart-wrap {
    height: 320px;
  }
}

th {
  background: var(--navy);
  color: #ffffff;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(11, 45, 79, 0.06);
  white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
}

tbody tr:hover {
  background: rgba(11, 45, 79, 0.03);
}

/* =========================================================
   VISTA RESUMEN EJECUTIVO
========================================================= */

.resumen-dashboard,
.resumen-executive {
  width: 100%;
}

.resumen-executive {
  position: relative;
  display: grid;
  gap: 16px;
}

.resumen-executive::before {
  content: "";
  position: absolute;
  inset: -18px;
  pointer-events: none;
  z-index: 0;
}

.resumen-executive > * {
  position: relative;
  z-index: 1;
}

/* Oculta hero/título duplicado si todavía existe en el HTML */
.resumen-hero,
.resumen-hero-left,
.resumen-hero-right,
.matrix-summary {
  display: none !important;
}

/* Cards superiores: Total + estados */
.resumen-composition,
.resumen-composition.compact,
.resumen-composition.with-total {
  display: grid;
  grid-template-columns: 1.15fr repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.composition-card {
  min-height: 112px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.composition-card.aprobado {
  --accent: var(--aprobado);
}

.composition-card.desaprobado {
  --accent: var(--desaprobado);
}

.composition-card.proceso {
  --accent: var(--proceso);
}

.composition-card.no-inicio {
  --accent: var(--no-inicio);
}

.composition-card.total-matriculados {
  --accent-local: #ffffff;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px rgba(11, 45, 79, 0.28);
}

.composition-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.composition-top strong {
  color: var(--accent);
}

.composition-value {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  font-weight: 950;
  color: var(--ink);
  letter-spacing: -0.04em;
}

.composition-track {
  height: 9px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.composition-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--accent),
    color-mix(in srgb, var(--accent) 60%, white)
  );
}

.composition-card.total-matriculados .composition-top {
  color: rgba(255, 255, 255, 0.75);
}

.composition-card.total-matriculados .composition-top strong,
.composition-card.total-matriculados .composition-value {
  color: #ffffff;
}

.composition-card.total-matriculados .composition-track {
  background: rgba(255, 255, 255, 0.18);
}

.composition-card.total-matriculados .composition-fill {
  width: 100% !important;
  background: linear-gradient(90deg, #ffffff, #8be8ff);
}

/* Tabla resumen */
.resumen-matrix-card {
  margin-top: 0;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.11);
  overflow: hidden;
}

.matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-bottom: 1px solid var(--line);
}

.matrix-kicker {
  font-size: 10px;
  font-weight: 950;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.matrix-header h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  font-weight: 950;
  letter-spacing: -0.03em;
}

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.matrix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.aprobado {
  background: var(--aprobado);
}

.legend-dot.desaprobado {
  background: var(--desaprobado);
}

.legend-dot.proceso {
  background: var(--proceso);
}

.legend-dot.no-inicio {
  background: var(--no-inicio);
}

.matrix-wrap {
  overflow: auto;
  max-height: 68vh;
}

.executive-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.executive-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--navy);
  color: #ffffff;
  padding: 10px 9px;
  font-size: 10.5px;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(59, 130, 246, 0.5);
}

.executive-table th:nth-child(1),
.executive-table th:nth-child(2) {
  text-align: left;
}

.executive-table td {
  padding: 9px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.95);
  text-align: right;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.executive-table tbody tr:hover td {
  background: #f8fafc;
}

.group-cell {
  min-width: 170px;
  background: #0a2442 !important;
  color: #ffffff !important;
  text-align: left !important;
  vertical-align: top;
  font-weight: 950 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.level-cell {
  min-width: 130px;
  text-align: left !important;
  font-weight: 950 !important;
  color: var(--navy) !important;
}

.aprobado-text {
  color: var(--aprobado) !important;
}

.desaprobado-text {
  color: var(--desaprobado) !important;
}

.proceso-text {
  color: #a47600 !important;
}

.no-inicio-text {
  color: var(--no-inicio) !important;
}

.total-bold {
  font-weight: 950 !important;
  color: var(--navy) !important;
}

.mini-stack {
  display: flex;
  width: 150px;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
  margin-left: auto;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.mini-stack .seg {
  height: 100%;
  min-width: 0;
}

.mini-stack .aprobado {
  background: var(--aprobado);
}

.mini-stack .desaprobado {
  background: var(--desaprobado);
}

.mini-stack .proceso {
  background: var(--proceso);
}

.mini-stack .no-inicio {
  background: var(--no-inicio);
}

.executive-total-row td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: #0b2949 !important;
  color: #ffffff !important;
  font-weight: 950 !important;
  border-top: 2px solid rgba(255, 255, 255, 0.22);
}

.executive-total-row .mini-stack {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

/* Compatibilidad con clases antiguas de resumen */
.resumen-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.estado-card {
  position: relative;
  min-height: 92px;
  border-radius: 18px;
  padding: 14px 18px;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.estado-card-label {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  text-align: center;
}

.estado-card-value {
  margin-top: 5px;
  font-size: 28px;
  font-weight: 950;
  text-align: center;
}

.estado-card-pct {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.estado-aprobado {
  background: linear-gradient(135deg, #18b86b, #0b934f);
}

.estado-desaprobado {
  background: linear-gradient(135deg, #22a6c7, #087d91);
}

.estado-proceso {
  background: linear-gradient(135deg, #e7bd20, #c59c08);
}

.estado-no-inicio {
  background: linear-gradient(135deg, #e84c4c, #c82323);
}

.estado-total {
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
}

/* =========================================================
   VISTA AVANCE
========================================================= */

.avance-dashboard {
  width: 100%;
}

.avance-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.avance-table-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
}

/* =========================================================
   VISTA NEXUS PREMIUM
========================================================= */

.nexus-dashboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nexus-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 22px;
}

.nexus-charts-grid.tight {
  grid-template-columns: 1.15fr 1fr;
}

.nexus-chart-card.span-2 {
  grid-column: 1 / -1;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 340px;
}

.chart-box.sm {
  height: 300px;
}
.chart-box.md {
  height: 360px;
}
.chart-box.lg {
  height: 460px;
}

.nexus-chart-card {
  position: relative;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    0 20px 50px rgba(7, 38, 83, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s ease;
  overflow: hidden;
}

.nexus-chart-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 30px 60px rgba(7, 38, 83, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 1);
}

.nexus-chart-title {
  font-size: 14px;
  font-weight: 950;
  color: #072653;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nexus-chart-title::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5a10a;
  box-shadow: 0 0 10px rgba(229, 161, 10, 0.6);
}

.nexus-chart-card canvas {
  width: 100% !important;
  height: 100% !important;
}

.nexus-table-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(7, 38, 83, 0.08);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.nexus-table-header {
  padding: 20px 24px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 250, 252, 0.8)
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nexus-table-title {
  font-size: 18px;
  font-weight: 950;
  color: #072653;
  letter-spacing: -0.02em;
}

.nexus-table-wrap {
  max-height: 60vh;
  overflow: auto;
}

.nexus-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.nexus-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--navy);
  color: #ffffff;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(59, 130, 246, 0.5);
}

.nexus-table td {
  padding: 12px 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #1e293b;
  font-weight: 700;
  transition: background 0.2s ease;
}

.nexus-table tbody tr:hover td {
  background: rgba(233, 241, 255, 0.6);
}

.nexus-table td.col-heavy {
  font-weight: 950;
  color: #072653;
}

.nexus-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.nexus-badge.encontrado {
  background: rgba(7, 38, 83, 0.15);
  color: #072653;
}

.nexus-badge.no-encontrado {
  background: rgba(229, 161, 10, 0.15);
  color: #b47d00;
}

.nexus-badge.otros {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {
  .resumen-composition,
  .resumen-composition.compact,
  .resumen-composition.with-total {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 1100px) {
  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-grid,
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .nexus-charts-grid {
    grid-template-columns: 1fr;
  }

  .matrix-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .resumen-composition,
  .resumen-composition.compact,
  .resumen-composition.with-total {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .page {
    padding: 12px;
  }
  .brand-block {
    padding: 20px;
  }
  .tabs,
  .kpi-grid,
  .filters-grid {
    grid-template-columns: 1fr;
  }
  .content-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .resumen-composition,
  .resumen-composition.compact,
  .resumen-composition.with-total,
  .resumen-kpis,
  .avance-kpis {
    grid-template-columns: 1fr;
  }

  .header-title {
    font-size: 16px;
  }
}

/* =========================================================
   RESUMEN - MATRIZ POR CARGO
========================================================= */

.cargo-matrix-card {
  margin-top: 18px;
}

.cargo-table {
  min-width: 1180px;
}

.cargo-table .cargo-col {
  text-align: left;
  min-width: 320px;
}

.cargo-cell {
  text-align: left !important;
  font-weight: 900 !important;
  color: var(--navy) !important;
  background: #f8fafc !important;
  max-width: 420px;
  white-space: normal !important;
  line-height: 1.25;
}

.cargo-table tbody tr:hover .cargo-cell {
  background: #eef6ff !important;
}

.cargo-matrix-card .matrix-header {
  background:
    linear-gradient(180deg, #ffffff, #f8fafc),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.12), transparent 26%);
}

/* =========================================================
   NOMINAL - INDICADORES Y FILTROS
========================================================= */

.kpi-grid-resumen {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.resumen-kpi-card.aprobado::before {
  background: #16a34a;
}

.resumen-kpi-card.desaprobado::before {
  background: #22a6c7;
}

.resumen-kpi-card.proceso::before {
  background: #d6a800;
}

.resumen-kpi-card.no-inicio::before {
  background: #dc2626;
}

.resumen-kpi-card.total {
  background: linear-gradient(135deg, #0b2d4f, #123d68);
}

.resumen-kpi-card.total .kpi-label,
.resumen-kpi-card.total .kpi-value,
.resumen-kpi-card.total .kpi-note {
  color: #ffffff;
}

.nominal-dashboard {
  display: grid;
  gap: 16px;
}

.nominal-filter-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: end;
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(0, 166, 200, 0.06)),
    #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.nominal-filter-head {
  padding-right: 8px;
}

.nominal-filter-sub {
  margin-top: 8px;
  max-width: 44ch;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 600;
}

.nominal-filter-card h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 950;
  color: var(--navy);
  letter-spacing: -0.04em;
}

.nominal-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.nominal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.nominal-actions .btn {
  height: 42px;
  white-space: nowrap;
}

.nominal-download-btn.btn-primary {
  box-shadow: 0 12px 22px rgba(59, 130, 246, 0.22);
}

/* botones nominal: altura se define en .nominal-actions .btn */

.nominal-table-wrap {
  max-height: 65vh;
  overflow: auto;
}

.nominal-table {
  min-width: 1360px;
}

.nominal-table th {
  background: var(--navy);
  color: #ffffff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.doc-cell {
  font-weight: 950;
  color: #0b2d4f;
}

.name-cell {
  font-weight: 900;
  color: #111827;
}

.condition-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.condition-badge.aprobado {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.condition-badge.desaprobado {
  background: rgba(34, 166, 199, 0.14);
  color: #087f9a;
}

.condition-badge.proceso {
  background: rgba(214, 168, 0, 0.16);
  color: #9a6b00;
}

.condition-badge.no-inicio {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.condition-badge.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

@media (max-width: 1200px) {
  .kpi-grid-resumen {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .nominal-filter-card {
    grid-template-columns: 1fr;
  }

  .nominal-filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .kpi-grid-resumen {
    grid-template-columns: 1fr;
  }
}
