@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap");

:root {
  --primary: #0f4c8a;
  --primary-dk: #082d54;
  --primary-md: #1a6bbf;
  --primary-lt: #e8f1fb;
  --accent: #f59e0b;
  --accent-lt: #fef3c7;
  --success: #059669;
  --success-lt: #d1fae5;
  --danger: #dc2626;
  --danger-lt: #fee2e2;
  --warning: #d97706;
  --warning-lt: #fef3c7;
  --neutral: #64748b;
  --neutral-lt: #f1f5f9;
  --bg: #f0f4f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-md: #cbd5e1;
  --text: #0f172a;
  --text-md: #334155;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.14);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", monospace;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

:root {
  --primary: #0f4c8a;
  --primary-dk: #082d54;
  --primary-md: #1a6bbf;
  --primary-light: #fff;
  --primary-light-md: #ffffff;
  --primary-light-dk: #fff0da;
  --primary-lt: #e8f1fb;
  --accent: #f59e0b;
  --accent-lt: #fef3c7;
  --success: #059669;
  --success-lt: #d1fae5;
  --danger: #dc2626;
  --danger-lt: #fee2e2;
  --warning: #d97706;
  --warning-lt: #fef3c7;
  --neutral: #64748b;
  --neutral-lt: #f1f5f9;
  --bg: #f0f4f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-md: #cbd5e1;
  --text: #0f172a;
  --text-md: #334155;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.14);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", monospace;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-image: url("../../../assets/img/hero-bg-light.webp");
  font-family:
    "Titillium Web",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  margin: 0;
  background-size: cover;

  /* Centra la imagen */
  background-position: center center;

  /* Evita que la imagen se repita */
  background-repeat: no-repeat;

  /* Fija la imagen para que no se mueva al hacer scroll */
  background-attachment: fixed;

  /* Asegura que el fondo cubra todo el viewport */
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.774);
  /* Capa blanca semitransparente */
  z-index: -1;
  pointer-events: none;
}

/* ─── HEADER ─────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(
    130deg,
    var(--primary-light-dk) 0%,
    var(--primary-light) 55%,
    var(--primary-light-md) 100%
  );
  color: var(--primary-dk);
  padding: 0 28px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(8, 45, 84, 0.35);
}
.app-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.header-brand h1 {
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.header-brand p {
  font-size: 13px !important;
  font-weight: 500;
  margin-top: 1px;
}
.header-meta {
  font-size: 14px;
  text-align: right;
  line-height: 1.5;
}

.header-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #d97706;
  padding: 8px 16px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  box-shadow: 0 4px 6px rgba(255, 255, 255, 0.301);
  position: relative;
  overflow: hidden;
}

/* Efecto de onda al hacer hover */
.header-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(39, 187, 255, 0.425);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.header-button:hover::before {
  width: 300px;
  height: 300px;
}

.header-button:hover {
  background-color: #b85e00;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.header-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #a05200;
}

.header-button a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.header-button .material-icons {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.header-button:hover .material-icons {
  transform: scale(1.1);
}

/* Efecto de brillo */
.header-button::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  transition: transform 0.6s;
  pointer-events: none;
}

.header-button:hover::after {
  transform: rotate(30deg) translate(50%, 50%);
}

/* Para pantallas pequeñas */
@media (max-width: 768px) {
  .header-button {
    padding: 6px 12px;
  }

  .header-button a {
    font-size: 12px;
  }

  .header-button .material-icons {
    font-size: 16px;
  }
}

/* ---- BOTON DE RETORNO ---*/
.nav-item {
  background-color: #fc8600 !important;
  color: #ffffff !important;
  border-radius: 15px;
  box-shadow:
    0 10px 15px -3px rgba(255, 255, 255, 0.719),
    0 4px 6px -2px rgba(255, 255, 255, 0.226);
  padding: 7px 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1000;
}

.nav-item:hover {
  transform: translateY(-4px);
  box-shadow:
    0 15px 20px -3px rgba(14, 132, 206, 0.3),
    0 8px 10px -2px rgba(17, 103, 146, 0.2);

  /* Sutil cambio de color al hover */
  background-color: var(--accent);
}

/* Efecto de brillo al pasar el mouse (opcional) */
.nav-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.548),
    transparent
  );
  transition: left 0.5s ease;
}

.nav-item:hover::after {
  left: 100%;
}

/* Para el enlace dentro del nav-item */
.nav-item .nav-link {
  color: var(--primary-dk) !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
}

/* Efecto sutil para el ícono */
.nav-item .nav-link i {
  color: var(--primary-light) !important;
  transition: transform 0.2s ease;
}

.nav-item:hover .nav-link i {
  transform: scale(1.1);
}

.nav-item a {
  color: var(--primary-light) !important;
}

/* ─── HEADER ─────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(
    130deg,
    var(--primary-dk) 0%,
    var(--primary) 55%,
    var(--primary-md) 100%
  );
  color: #fff;
  padding: 0 28px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(8, 45, 84, 0.35);
}
.app-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.header-brand h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.header-brand p {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
  margin-top: 1px;
}
.header-meta {
  font-size: 11px;
  opacity: 0.65;
  text-align: right;
  line-height: 1.5;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container {
  max-width: 1520px;
  margin: 0 auto;
  padding: 22px 24px 50px;
}

/* ─── FILTROS ────────────────────────────────────────────── */
.filtros-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.filtro-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
  flex: 1;
  max-width: 220px;
}
.filtro-group label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.filtro-group label i {
  font-size: 11px;
  opacity: 0.8;
}

.filtro-group select {
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 8px 32px 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-md);
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.filtro-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 138, 0.12);
}
.filtros-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.15s;
}
.btn:hover::after {
  background: rgba(255, 255, 255, 0.12);
}
.btn:active {
  transform: scale(0.97);
}
.btn i {
  font-size: 13px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 76, 138, 0.3);
}
.btn-primary:hover {
  background: var(--primary-md);
  box-shadow: 0 4px 14px rgba(15, 76, 138, 0.4);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-lt);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-md);
}
.btn-ghost:hover {
  background: var(--neutral-lt);
  color: var(--text);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-icon {
  padding: 7px 10px;
}

/* ─── PESTAÑAS DE FASE ───────────────────────────────────── */
.fase-tabs-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.fase-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 28px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  min-width: 160px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.fase-tab-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: var(--transition);
}
.fase-tab-btn i {
  font-size: 20px;
  color: var(--text-muted);
  transition: var(--transition);
  margin-bottom: 2px;
}
.fase-tab-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  transition: var(--transition);
}
.fase-tab-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
}
.fase-tab-btn:hover:not(.disabled):not(.active) {
  border-color: var(--primary-md);
  background: var(--primary-lt);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.fase-tab-btn:hover:not(.disabled):not(.active) i,
.fase-tab-btn:hover:not(.disabled):not(.active) .fase-tab-label {
  color: var(--primary);
}

.fase-tab-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 4px 16px rgba(15, 76, 138, 0.3);
  transform: translateY(-2px);
}
.fase-tab-btn.active::before {
  background: rgba(255, 255, 255, 0.3);
}
.fase-tab-btn.active i {
  color: #fff;
}
.fase-tab-btn.active .fase-tab-label {
  color: #fff;
}
.fase-tab-btn.active .fase-tab-sub {
  color: rgba(255, 255, 255, 0.7);
}

.fase-tab-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--neutral-lt);
}

/* ─── TABS ───────────────────────────────────────────────── */
.tabs-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.tabs {
  display: flex;
  gap: 0;
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 20px;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn i {
  font-size: 14px;
}
.tab-btn:hover:not(.active) {
  color: var(--text);
  background: var(--neutral-lt);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}
.tab-panel.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── TARJETAS KPI ───────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.kpi-card.blue::before {
  background: var(--primary);
}
.kpi-card.green::before {
  background: var(--success);
}
.kpi-card.amber::before {
  background: var(--accent);
}
.kpi-card.red::before {
  background: var(--danger);
}
.kpi-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kpi-card.blue .kpi-icon {
  background: var(--primary-lt);
  color: var(--primary);
}
.kpi-card.green .kpi-icon {
  background: var(--success-lt);
  color: var(--success);
}
.kpi-card.amber .kpi-icon {
  background: var(--accent-lt);
  color: var(--warning);
}
.kpi-card.red .kpi-icon {
  background: var(--danger-lt);
  color: var(--danger);
}

.kpi-body {
  color: #ffffff;
}
.kpi-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.kpi-card.blue .kpi-value {
  color: var(--primary);
}
.kpi-card.green .kpi-value {
  color: var(--success);
}
.kpi-card.amber .kpi-value {
  color: var(--warning);
}
.kpi-card.red .kpi-value {
  color: var(--danger);
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* ─── SECCIÓN GRÁFICOS ───────────────────────────────────── */
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-title i {
  font-size: 14px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.chart-card:hover {
  box-shadow: var(--shadow);
}
.chart-card canvas {
  max-height: 240px;
}

/* ─── INDICADORES ────────────────────────────────────────── */
.indicadores-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.indicadores-tabla {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ind-row {
  display: grid;
  grid-template-columns: 32px 1fr 220px 100px 70px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.ind-row:hover {
  background: var(--primary-lt);
}
.ind-row + .ind-row {
  border-top: 1px dashed var(--border);
}

.ind-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: center;
  background: var(--neutral-lt);
  border-radius: 6px;
  padding: 3px 0;
}
.ind-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-md);
  line-height: 1.4;
}
.ind-bar-wrap {
  background: #e9eef5;
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}
.ind-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.ind-bar-fill.ok {
  background: linear-gradient(90deg, #059669, #34d399);
}
.ind-bar-fill.warning {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}
.ind-bar-fill.danger {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.ind-counts {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.ind-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.ind-pill.si {
  background: var(--success-lt);
  color: var(--success);
}
.ind-pill.no {
  background: var(--danger-lt);
  color: var(--danger);
}
.ind-pill i {
  font-size: 9px;
}

.ind-pct-wrap {
  border-radius: 8px;
  padding: 5px 8px;
  text-align: center;
}
.ind-pct {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  display: block;
}

@media (max-width: 900px) {
  .ind-row {
    grid-template-columns: 28px 1fr 80px;
  }
  .ind-bar-wrap,
  .ind-counts {
    display: none;
  }
}

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge i {
  font-size: 10px;
}
.badge-si {
  background: var(--success-lt);
  color: var(--success);
}
.badge-no {
  background: var(--danger-lt);
  color: var(--danger);
}
.badge-parcial {
  background: var(--accent-lt);
  color: var(--warning);
}
.badge-nd {
  background: var(--neutral-lt);
  color: var(--neutral);
}

/* ─── TABLA DETALLE ──────────────────────────────────────── */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.table-info {
  font-size: 12.5px;
  color: var(--text-muted);
}
.table-info strong {
  color: var(--text);
  font-weight: 700;
}

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 1600px;
}

thead th {
  background: var(--primary);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 5;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
thead th:last-child {
  border-right: none;
}
thead th i {
  margin-right: 4px;
  opacity: 0.8;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: var(--primary-lt);
}
tbody tr:nth-child(even) {
  background: #fafbfd;
}
tbody tr:nth-child(even):hover {
  background: var(--primary-lt);
}

tbody td {
  padding: 9px 14px;
  vertical-align: middle;
  white-space: nowrap;
}
tbody td.td-nombre {
  white-space: normal;
  min-width: 200px;
  max-width: 280px;
  line-height: 1.4;
  font-weight: 600;
}
tbody td.td-centro {
  text-align: center;
}

.td-cmod {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--primary);
  font-weight: 500;
}
.td-dist {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-md);
}
.td-nivel {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-lt);
  color: var(--primary);
  white-space: nowrap;
}
.td-fase {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.btn-ficha {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary-lt);
  color: var(--primary);
  border: 1px solid rgba(15, 76, 138, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}
.btn-ficha:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 76, 138, 0.35);
  transform: scale(1.08);
}

/* ─── PAGINACIÓN ─────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12.5px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.page-btn:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-lt);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── COMPARATIVO ────────────────────────────────────────── */
.comp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.comp-card canvas {
  max-height: 420px;
}

.comp-resumen {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.comp-fase-card {
  background: var(--primary-lt);
  border: 1px solid rgba(15, 76, 138, 0.15);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.comp-fase-card .fase-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.comp-fase-card .fase-total {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 4px 0;
}
.comp-fase-card .fase-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 45, 84, 0.55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes modalIn {
  from {
    transform: scale(0.92) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
.modal-header {
  background: linear-gradient(130deg, var(--primary-dk), var(--primary));
  color: #fff;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}
.modal-header-info {
  color: #ffffff;
}
.modal-header h2 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}
.modal-header .modal-subtitle {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header .modal-subtitle span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.modal-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 12px;
  transition: var(--transition);
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  overflow-y: auto;
  padding: 22px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border-md) transparent;
}
.modal-body::-webkit-scrollbar {
  width: 5px;
}
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-md);
  border-radius: 10px;
}

.ficha-seccion {
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ficha-seccion-header {
  background: var(--primary-lt);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.ficha-seccion-header i {
  font-size: 14px;
  color: var(--primary);
  width: 20px;
  text-align: center;
}
.ficha-seccion-header h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  font-weight: 700;
}
.ficha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}
.ficha-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.ficha-item:nth-child(even) {
  border-right: none;
}
.ficha-item:last-child,
.ficha-item:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}
.ficha-item.full {
  grid-column: 1/-1;
  border-right: none;
}
.fi-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}
.fi-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}

/* ─── SPINNER ────────────────────────────────────────────── */
.spinner-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 50px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 48px;
  opacity: 0.25;
  display: block;
  margin-bottom: 14px;
}
.empty-state p {
  font-size: 15px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .progress-label {
    flex: 0 0 160px;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .ficha-grid {
    grid-template-columns: 1fr;
  }
  .header-meta {
    display: none;
  }
  .filtro-group {
    max-width: 100%;
  }
  .tabs-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Agregar al final del archivo biae.css */

/* Modal para PDF - más grande */
.modal-pdf {
  max-width: 95%;
  width: 95%;
  height: 90vh;
}

.modal-pdf .modal-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-pdf iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #f5f5f5;
}

/* Toast Notification - Agregar al final del archivo biae.css */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  font-family: var(--font);
}

.toast-notification.show {
  transform: translateX(0);
}

.toast-notification i {
  font-size: 16px;
}

.toast-notification.error {
  background: #dc2626;
}

.toast-notification.success {
  background: #059669;
}

.toast-notification.warning {
  background: #d97706;
}

/* Botón PDF */
.btn-pdf {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fef3c7;
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  margin-left: 6px;
}

.btn-pdf:hover {
  background: #d97706;
  color: #fff;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.35);
  transform: scale(1.08);
}

.acciones-botones {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}
