:root {
  --nav: #0b1020;
  --nav2: #111936;
  --gold: #f6b73c;
  --cyan: #28d3ff;
  --bg: #f3f6fb;
  --card: #ffffff;
  --txt: #1d2433;
  --muted: #6b7280;
  --green: #16a34a;
  --orange: #f59e0b;
  --red: #ef4444;
  --blue: #2563eb;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: linear-gradient(135deg, #eaf2ff, #f7f9fc);
  color: var(--txt);
}
.page-shell {
  width: 95%;
  max-width: 1760px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.04),
    0 30px 90px rgba(15, 23, 42, 0.14);
}
.preheader {
  background: #050816;
  color: #dbeafe;
  font-size: 12px;
  padding: 7px 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.pre-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pre-nav a,
.pre-nav span {
  color: #e0f2fe;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: 0.2s;
}
.pre-nav a:hover {
  background: var(--gold);
  color: #0f172a;
  transform: translateY(-1px);
}
.topbar {
  background: linear-gradient(90deg, #0b1020, #162147);
  color: white;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #08111f;
}
.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.top-actions button,
.upload-box label,
.btn-primary,
.btn-dark {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-primary {
  background: var(--gold);
  color: #111827;
}
.btn-dark {
  background: #202a44;
  color: #fff;
}
.btn-primary:hover,
.btn-dark:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.banner {
  min-height: 96px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(14, 165, 233, 0.82)),
    url("../img/banner.svg");
  background-size: cover;
  color: white;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.banner h1 {
  font-size: 24px;
  margin: 0;
}
.banner p {
  margin: 6px 0 0;
  color: #eaf2ff;
}
.badge {
  display: inline-block;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 800;
}
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 190px);
}
.sidebar {
  background: linear-gradient(180deg, var(--nav), var(--nav2));
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.side-title {
  color: #93c5fd;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 8px 12px 14px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #d7def5;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
  margin: 5px 0;
  transition: 0.18s;
}
.nav-btn:hover,
.nav-btn.active {
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  color: white;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.18);
  transform: translateX(2px);
}
main {
  padding: 22px;
  min-width: 0;
}
.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.filter-card {
  background: var(--card);
  padding: 12px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.filter-card label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 6px;
}
.filter-card select {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 10px;
  background: white;
  color: #111827;
}
.section {
  display: none;
}
.section.active {
  display: block;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: linear-gradient(180deg, #fff, #f8fbff);
  border-left: 5px solid var(--blue);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.kpi small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}
.kpi strong {
  font-size: 18px;
  display: block;
  margin-top: 6px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.card {
  background: var(--card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-small {
  height: 250px;
}
.table-wrap {
  overflow: auto;
  max-height: 70vh;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: white;
  table-layout: fixed;
}
.data-table th {
  background: linear-gradient(90deg, #0f172a, #1e3a8a);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-size: 11px;
}
.data-table th,
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.data-table td {
  color: #273449;
}
.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table .col-cod {
  width: 82px;
}
.data-table .col-meta {
  width: 70px;
}
.data-table .col-fuente {
  width: 90px;
}
.data-table .col-generica {
  width: 92px;
}
.data-table .col-programa,
.data-table .col-nombre,
.data-table .col-detalle {
  width: 210px;
  max-width: 210px;
}
.data-table .col-largo {
  width: 260px;
  max-width: 260px;
}
.data-table .col-monto {
  width: 118px;
}
.data-table .col-pct {
  width: 78px;
}
.compact-table .col-detalle {
  width: 160px;
  max-width: 160px;
}
.compact-table .col-monto {
  width: 110px;
}
.compact-table .col-pct {
  width: 62px;
}
.data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.data-table tbody tr:nth-child(odd) {
  background: #ffffff;
}
.data-table tbody tr:hover {
  background: #eff6ff;
}
.note {
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border-left: 4px solid #38bdf8;
  border-radius: 12px;
  padding: 10px;
}
.gauge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gauge-card {
  text-align: center;
  background: #f8fafc;
  border-radius: 20px;
  padding: 16px;
}
.gauge-value {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  margin-top: -18px;
}
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.report-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-print-report {
  box-shadow: 0 12px 24px rgba(246, 183, 60, 0.22);
}
.report-tab {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
}
.report-tab.active,
.report-tab:hover {
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  color: white;
}
.report-panel {
  display: none;
}
.report-panel.active {
  display: block;
}
.prefooter {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 18px;
  background: #0b1020;
  color: #dbeafe;
  padding: 26px 28px;
}
.prefooter h4 {
  color: white;
  margin: 0 0 10px;
}
.prefooter p {
  font-size: 13px;
  line-height: 1.45;
}
.socials {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.socials a {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #172554;
  color: white;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 20px;
}
.socials a:hover {
  background: var(--gold);
  color: #0f172a;
}
.map {
  width: 100%;
  height: 210px;
  border: 0;
  border-radius: 16px;
}
.news {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.footer {
  text-align: center;
  background: #050816;
  color: #cbd5e1;
  padding: 14px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.modal-overlay.visible {
  display: flex;
}
.modal-card {
  width: min(720px, 95vw);
  background: white;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.35);
  position: relative;
}
.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  border: 0;
  background: #e2e8f0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
}
.admin-login,
.admin-panel {
  background: #f8fafc;
  border-radius: 18px;
  padding: 16px;
  margin-top: 14px;
  border: 1px solid #e2e8f0;
}
.admin-panel {
  display: none;
  background: #0f172a;
  color: white;
}
.admin-panel.visible {
  display: block;
}
.login-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.login-row input {
  flex: 1;
  min-width: 220px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px;
}
.upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.upload-box input {
  display: none;
}
@media (max-width: 1250px) {
  .page-shell {
    width: 97%;
  }
  .kpis {
    grid-template-columns: repeat(4, 1fr);
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .filters {
    grid-template-columns: repeat(3, 1fr);
  }
  .prefooter {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 850px) {
  .page-shell {
    width: 100%;
  }
  .preheader,
  .topbar,
  .banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .side-title {
    grid-column: 1/-1;
  }
  .nav-btn {
    margin: 0;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
  .grid-3,
  .gauge-grid,
  .prefooter {
    grid-template-columns: 1fr;
  }
  .chart-small {
    height: 220px;
  }
}
@media (max-width: 520px) {
  .sidebar {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .banner h1 {
    font-size: 20px;
  }
  .top-actions {
    width: 100%;
  }
  .top-actions button {
    width: 100%;
    justify-content: center;
  }
}
@media print {
  body {
    background: white;
  }
  .preheader,
  .topbar,
  .sidebar,
  .filters,
  .prefooter,
  .footer,
  .modal-overlay,
  .banner,
  .report-toolbar {
    display: none !important;
  }
  .page-shell {
    width: 100%;
    box-shadow: none;
    background: white;
  }
  .layout {
    display: block;
  }
  main {
    padding: 0;
  }
  .section {
    display: none !important;
  }
  .section.active {
    display: block !important;
  }
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
    border-radius: 8px;
  }
  .table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
  }
  .data-table {
    font-size: 9px;
    table-layout: auto;
  }
  .data-table th,
  .data-table td {
    padding: 5px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .data-table .col-programa,
  .data-table .col-nombre,
  .data-table .col-detalle,
  .data-table .col-largo {
    width: auto;
    max-width: none;
  }
  body.print-report .section {
    display: none !important;
  }
  body.print-report #reportes {
    display: block !important;
  }
  body.print-report .report-panel {
    display: none !important;
  }
  body.print-report .report-panel.active {
    display: block !important;
  }
}

/* ===== Producción V6: actualización, menú externo y gauges animados ===== */
.banner-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.update-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(8, 8, 8, 0.28);
  color: #121111;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.18);
}
.update-badge strong {
  color: #f50707;
}
.update-badge small {
  opacity: 0.9;
  border-left: 1px solid rgba(3, 3, 3, 0.35);
  padding-left: 8px;
}
.external-link {
  text-decoration: none;
}
.external-link .ms-auto {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.85;
}
.nav-btn.external-link {
  border: 1px solid rgba(40, 211, 255, 0.18);
  background: rgba(40, 211, 255, 0.06);
}
.nav-btn.external-link:hover {
  background: linear-gradient(90deg, #059669, #0ea5e9);
  color: #fff;
}
.gauge-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}
.gauge-card::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: radial-gradient(
    circle,
    rgba(40, 211, 255, 0.13),
    transparent 42%
  );
  animation: gaugeAura 4.5s ease-in-out infinite;
  pointer-events: none;
}
.gauge-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
  border-color: rgba(14, 165, 233, 0.35);
}
.gauge-card canvas {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 10px 12px rgba(15, 23, 42, 0.12));
  animation: gaugeFloat 2.8s ease-in-out infinite;
}
.gauge-value {
  position: relative;
  z-index: 2;
  animation: gaugeGlow 2.2s ease-in-out infinite;
}
.gauge-card.gauge-red .gauge-value {
  color: #dc2626;
}
.gauge-card.gauge-orange .gauge-value {
  color: #d97706;
}
.gauge-card.gauge-green .gauge-value {
  color: #16a34a;
}
.gauge-card.gauge-red {
  animation: dangerPulse 1.05s ease-in-out infinite;
}
.gauge-card.gauge-orange {
  animation: warnPulse 1.7s ease-in-out infinite;
}
.gauge-card.gauge-green {
  animation: okPulse 2.6s ease-in-out infinite;
}
@keyframes gaugeAura {
  0%,
  100% {
    transform: translate(-5%, -5%) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translate(5%, 5%) scale(1.08);
    opacity: 0.9;
  }
}
@keyframes gaugeFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-0.35deg);
  }
  50% {
    transform: translateY(-2px) rotate(0.35deg);
  }
}
@keyframes gaugeGlow {
  0%,
  100% {
    text-shadow: 0 0 6px rgba(14, 165, 233, 0.25);
  }
  50% {
    text-shadow: 0 0 18px rgba(14, 165, 233, 0.55);
  }
}
@keyframes dangerPulse {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.12);
  }
  50% {
    box-shadow: 0 18px 44px rgba(239, 68, 68, 0.3);
  }
}
@keyframes warnPulse {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.12);
  }
  50% {
    box-shadow: 0 18px 44px rgba(245, 158, 11, 0.25);
  }
}
@keyframes okPulse {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.1);
  }
  50% {
    box-shadow: 0 18px 44px rgba(22, 163, 74, 0.2);
  }
}
@media (max-width: 850px) {
  .banner-status {
    align-items: flex-start;
  }
  .update-badge {
    border-radius: 16px;
    flex-wrap: wrap;
  }
  .update-badge small {
    border-left: 0;
    padding-left: 0;
    width: 100%;
  }
}
@media print {
  .update-badge {
    color: #111 !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
  }
  .banner-status {
    align-items: flex-start;
  }
}
/* lineas verticales */
.border-right-custom {
  position: relative;
  padding-left: 25px;
  padding-right: 25px;
}

.border-right-custom::after {
  content: "";
  position: absolute;
  top: 10%;
  right: 0;
  width: 2px;
  height: 80%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.65),
    transparent
  );
  animation: lineaPrefooter 2.5s ease-in-out infinite;
}

@keyframes lineaPrefooter {
  0% {
    opacity: 0.25;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.85);
  }
  100% {
    opacity: 0.25;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
  }
}

@media (max-width: 768px) {
  .border-right-custom::after {
    display: none;
  }
}

/* enlace de la web */
.web-risascope {
  color: #fff;
  padding: 8px 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-decoration: none;
  transition: all 0.4s ease;
}

.web-risascope:hover {
  background: #d3e5a2;
  color: #0d0d0d;
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 0 10px rgb(254, 253, 253);
  transform: scale(1.08);
}
.border-right-custom {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.border-right-custom {
  position: relative;
  padding-left: 20px;
  padding-right: 20px;
}
