/* Tema oscuro con Poppins + boton Exportar con estilo del sitio */
:root {
  --brand-primary: #0097ce;
  --brand-accent: #ff5b56;
  --brand-accent-dark: #e24b47;
  --fs-text: #e9eef3;
  --fs-muted: #b8c2cc;
  --fs-invert: #0a0a0a;
  --fs-surface: #0f141a;
  --fs-surface-2: #121920;
  --fs-border: #1f2a33;
  --fs-radius: 12px;
  --fs-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  --fs-speed: 240ms;
  --fs-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fs-col-hi: rgba(0, 151, 206, 0.08);
}

/* Base */
.fs-wrapper {
  font: 14px "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, sans-serif;
  margin: 1.2rem 0;
  color: var(--fs-text);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--fs-invert);
  border-radius: var(--fs-radius);
  overflow: hidden;
}

.fs-titulo {
  margin: 0 0 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--fs-text);
}

.fs-aggregado {
  background: linear-gradient(180deg, #0a0f14 0%, #0a0a0a 100%);
  padding: 14px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.fs-data {
  background: var(--fs-surface);
  border: 1px solid var(--fs-border);
  padding: 16px;
  border-radius: var(--fs-radius);
  box-shadow: var(--fs-shadow);
  box-sizing: border-box;
  overflow: visible;
}

/* Barra de busqueda + acciones */
.fs-busqueda-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(15, 20, 26, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 0.9rem;
  padding: 10px 12px;
  transition: box-shadow var(--fs-speed) var(--fs-ease),
    background var(--fs-speed) var(--fs-ease),
    border-color var(--fs-speed) var(--fs-ease);
  background: var(--fs-surface-2);
}

.fs-busqueda-bar.fs-sticky {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.fs-busqueda-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 280px;
}

.fs-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fs-buscar {
  padding: 11px 12px;
  border: 1px solid var(--fs-border);
  border-radius: calc(var(--fs-radius) + 10px);
  min-width: 240px;
  font: inherit;
  background: #0e1319;
  color: var(--fs-text);
  height: 44px;
  line-height: 44px;
  transition: border-color var(--fs-speed) var(--fs-ease),
    box-shadow var(--fs-speed) var(--fs-ease),
    transform var(--fs-speed) var(--fs-ease);
}

.fs-buscar::placeholder {
  color: #8a95a1;
}

.fs-buscar:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(0, 151, 206, 0.18);
  transform: translateY(-1px);
}

.fs-clear {
  background: #0e1319;
  border: 1px solid var(--fs-border);
  color: #c9d2db;
  border-radius: calc(var(--fs-radius) + 10px);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--fs-speed) var(--fs-ease),
    background var(--fs-speed) var(--fs-ease),
    border-color var(--fs-speed) var(--fs-ease),
    color var(--fs-speed) var(--fs-ease);
}

.fs-clear:hover {
  background: #121920;
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px) scale(1.02);
}

.fs-count {
  font-size: 12px;
  color: var(--fs-muted);
}

.fs-count.pulse {
  animation: fsPulse 600ms var(--fs-ease);
}

@keyframes fsPulse {
  0% {
    transform: scale(0.96);
    opacity: 0.6;
  }
  60% {
    transform: scale(1.06);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* Botones */
.fs-btn {
  appearance: none;
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 999px;
  font: 600 13px/1 "Poppins", system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--fs-speed) var(--fs-ease),
    box-shadow var(--fs-speed) var(--fs-ease),
    background var(--fs-speed) var(--fs-ease),
    border-color var(--fs-speed) var(--fs-ease),
    color var(--fs-speed) var(--fs-ease);
}

.fs-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fs-btn.fs-btn-loading {
  opacity: 0.55;
  pointer-events: none;
}

.fs-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 91, 86, 0.18);
}

.fs-ico {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
}

.fs-btn-download {
  background: #001b95;
  border-color: #001b95;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.fs-btn-download:hover {
  background: linear-gradient(
    180deg,
    rgba(0, 27, 149, 0.18),
    rgba(0, 27, 149, 0.1)
  );
  color: #fff;
  border: 1px solid rgba(0, 27, 149, 0.35);
}

.fs-btn-download:active {
  transform: translateY(0);
}

.fs-btn-export {
  background: #0b4b31;
  border-color: #0b4b31;
  transform: translateY(-1px);
  color: #fff;
}

.fs-btn-export:hover {
  background: linear-gradient(180deg, rgba(11, 75, 49, 0.18), rgba(11, 75, 49, 0.1));
  color: #fff;
  border: 1px solid rgba(11, 75, 49, 0.35);
}

.fs-btn-export:active {
  transform: translateY(0);
}

/* Tabla */
.fs-table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--fs-border);
  background: var(--fs-surface-2);
}

.fs-tabla {
  border-collapse: collapse;
  width: 100%;
  table-layout: auto;
  color: var(--fs-text);
}

.fs-tabla th,
.fs-tabla td {
  border-bottom: 1px solid var(--fs-border);
  padding: 12px 12px;
  text-align: left;
  vertical-align: middle;
}

.fs-tabla th {
  background: linear-gradient(180deg, #111923, #0f141a);
  font-weight: 600;
  color: #d8e7f1;
  font-size: 13px;
  letter-spacing: 0.2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fs-tabla td.right,
.fs-tabla th.right {
  text-align: right;
}

.fs-tabla tbody tr {
  transition: background var(--fs-speed) var(--fs-ease),
    transform var(--fs-speed) var(--fs-ease);
}

.fs-tabla tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(2px);
}

.fs-tabla td:nth-last-child(-n + 6) {
  background: linear-gradient(180deg, rgba(0, 151, 206, 0.05), rgba(0, 0, 0, 0));
}

/* Chips numericos */
.fs-num {
  display: inline-block;
  min-width: 46px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #eaf7ff;
  background: linear-gradient(180deg, rgba(0, 151, 206, 0.18), rgba(0, 151, 206, 0.1));
  border: 1px solid rgba(0, 151, 206, 0.35);
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
  transform: scale(calc(0.96 + var(--fs-pop, 0) * 0.04));
  transition: transform 220ms var(--fs-ease), background 220ms var(--fs-ease),
    color 220ms var(--fs-ease), border-color 220ms var(--fs-ease);
}

.fs-num-count {
  background: linear-gradient(180deg, rgba(0, 200, 0, 0.9), rgba(0, 200, 0, 0.6));
}

.fs-num.pop-done {
  transform: none;
}

/* Aparicion escalonada + skeleton */
.fs-row.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

.fs-row.in {
  opacity: 1;
  transform: translateY(0);
  animation: fsFadeUp 420ms var(--fs-ease) both;
  animation-delay: var(--fs-stagger, 0ms);
}

@keyframes fsFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fs-skeleton .fs-skel,
.fs-skel {
  position: relative;
  overflow: hidden;
  background: #16212b;
  border-radius: 10px;
  height: 16px;
}

.fs-skel-text {
  width: 220px;
  height: 14px;
}

.fs-skel-text.short {
  width: 120px;
}

.fs-skel-chip {
  width: 64px;
  height: 26px;
  border-radius: 999px;
}

.fs-skel-num {
  width: 48px;
  height: 14px;
}

.fs-skel-card {
  border: 1px solid var(--fs-border);
  box-shadow: var(--fs-shadow);
  border-radius: var(--fs-radius);
}

.fs-skel:before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100%);
  animation: fsShimmer 1.2s infinite;
}

@keyframes fsShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Fade-in detalle */
.fs-fade-in {
  animation: fsFadeIn 360ms var(--fs-ease) both;
}

@keyframes fsFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Utilidades */
.text-muted {
  color: var(--fs-muted);
  font-size: 13px;
}

/* Scrollbar */
.fs-wrapper ::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.fs-wrapper ::-webkit-scrollbar-thumb {
  background: #1e2a34;
  border-radius: 10px;
}

.fs-wrapper ::-webkit-scrollbar-thumb:hover {
  background: #243544;
}

.fs-wrapper ::-webkit-scrollbar-track {
  background: #0e1319;
}

/* Mobile */
@media (max-width: 900px) {
  .fs-busqueda-left {
    min-width: 100%;
  }
  .fs-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .fs-tabla th,
  .fs-tabla td {
    padding: 10px 10px;
  }
  .fs-num {
    min-width: 40px;
    padding: 6px 10px;
  }
}

.fs-row-hidden {
  display: none;
}

.excelente {
  color: rgb(0, 200, 0);
  font-weight: bold;
}

.aceptable {
  color: #1565c0;
  font-weight: bold;
}

.medio {
  color: rgb(255, 255, 120);
  font-weight: bold;
}

.noaceptable {
  color: rgb(255, 91, 86);
  font-weight: bold;
}

.fs-simbologia {
  margin: 15px 0;
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  font-size: 14px;
}

.fs-legenda {
  padding: 5px 10px;
  border-radius: 16px;
  color: #fff;
  font-weight: bold;
}

.fs-aceptable {
  background: linear-gradient(180deg, rgba(0, 200, 0, 0.9), rgba(0, 200, 0, 0.6));
}

.fs-medio {
  background-color: rgb(255, 255, 120);
  color: #000;
}

.fs-noaceptable {
  background-color: rgb(255, 91, 86);
}

.fs-titulo-simbologia {
  color: grey;
}

th {
  padding: 6px;
  text-align: center;
  line-height: 1.2;
  word-break: keep-all;
  white-space: normal;
}

@media (max-width: 768px) {
  th {
    font-size: 0.8em;
  }
}
