/* ==========================================================================
   Sistema de diseño del panel: colores, tipografía, botones, formularios, tablas.
   Cambia las variables de :root y cambia todo. Clases con prefijo `tf-`.
   ========================================================================== */

:root {
  /* Marca */
  --tf-azul: #086ad8;
  --tf-azul-osc: #09468b;
  --tf-azul-claro: #1e84f6;
  --tf-degradado: linear-gradient(90deg, #09468b 0%, #1e84f6 100%);
  --tf-degradado-135: linear-gradient(135deg, #09468b 0%, #1e84f6 100%);

  /* Neutros */
  --tf-tinta: #0e2b3d;
  --tf-tinta-2: #24445a;
  --tf-texto: #5b6b78;
  --tf-suave: #8a97a3;
  --tf-borde: #e3eaf2;
  --tf-borde-fuerte: #cfdae6;
  --tf-fondo: #f3f7fd;
  --tf-fondo-2: #fafcff;
  --tf-blanco: #ffffff;

  /* Semánticos */
  --tf-ok: #10a37f;
  --tf-ok-bg: #e6f7f2;
  --tf-aviso: #e8890c;
  --tf-aviso-bg: #fdf3e3;
  --tf-error: #e03131;
  --tf-error-bg: #fdecec;
  --tf-info: #086ad8;
  --tf-info-bg: #e8f1fd;
  --tf-neutro-bg: #eef2f7;

  /* Formas */
  --tf-r-xs: 5px;
  --tf-r-sm: 8px;
  --tf-r-md: 12px;
  --tf-r-lg: 18px;
  --tf-r-full: 999px;

  /* Sombras */
  --tf-s-xs: 0 1px 2px rgba(14, 43, 61, .06);
  --tf-s-sm: 0 2px 8px rgba(14, 43, 61, .06);
  --tf-s-md: 0 8px 24px rgba(14, 43, 61, .08);
  --tf-s-lg: 0 20px 50px rgba(14, 43, 61, .12);
  --tf-s-azul: 0 10px 26px rgba(8, 106, 216, .28);

  --tf-trans: .28s cubic-bezier(.4, 0, .2, 1);
  --tf-fuente: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tf-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--tf-fuente);
  font-size: 15px;
  line-height: 1.7;
  color: var(--tf-texto);
  background: var(--tf-blanco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 15px;
  color: var(--tf-tinta);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.32rem; }
h4 { font-size: 1.08rem; }
h5 { font-size: .96rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--tf-azul); text-decoration: none; transition: color var(--tf-trans); }
a:hover { color: var(--tf-azul-osc); }

img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--tf-borde); margin: 24px 0; }

::selection { background: rgba(8, 106, 216, .16); color: var(--tf-tinta); }

/* --------------------------------- Layout -------------------------------- */

.tf-contenedor { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.tf-contenedor-ancho { max-width: 1400px; }
.tf-seccion { padding: clamp(60px, 9vw, 110px) 0; }
.tf-seccion--suave { background: var(--tf-fondo); }
.tf-seccion--tinta { background: var(--tf-tinta); color: #b9c8d4; }
.tf-seccion--tinta h1, .tf-seccion--tinta h2, .tf-seccion--tinta h3 { color: #fff; }

.tf-rejilla { display: grid; gap: 28px; }
.tf-rejilla--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tf-rejilla--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-rejilla--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------- Tipografía ------------------------------ */

.tf-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--tf-azul); margin-bottom: 14px;
}
.tf-eyebrow::before { content: ''; width: 26px; height: 2px; background: var(--tf-azul); border-radius: 2px; }
.tf-eyebrow--centro { justify-content: center; }

.tf-titular-seccion { max-width: 660px; margin: 0 auto 52px; text-align: center; }
.tf-titular-seccion.izq { margin-left: 0; text-align: left; }
.tf-titular-seccion p { font-size: 1.02rem; color: var(--tf-texto); margin-top: 14px; }
.tf-acento { color: var(--tf-azul); }
.tf-lead { font-size: 1.1rem; line-height: 1.75; }
.tf-suave { color: var(--tf-suave); }
.tf-mono { font-family: var(--tf-mono); font-variant-numeric: tabular-nums; }
.tf-num { font-variant-numeric: tabular-nums; }

/* --------------------------------- Botones ------------------------------- */

.tf-btn {
  --btn-bg: var(--tf-azul);
  --btn-color: #fff;
  --btn-borde: var(--tf-azul);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  padding: 13px 26px; border-radius: var(--tf-r-xs);
  background: var(--btn-bg); color: var(--btn-color);
  border: 2px solid var(--btn-borde);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: all var(--tf-trans);
}
.tf-btn:hover { color: var(--btn-color); transform: translateY(-2px); box-shadow: var(--tf-s-azul); }
.tf-btn:active { transform: translateY(0); }
.tf-btn:disabled, .tf-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.tf-btn:focus-visible { outline: 3px solid rgba(8, 106, 216, .35); outline-offset: 2px; }

.tf-btn--degradado { background: var(--tf-degradado); border-color: transparent; }
.tf-btn--linea { --btn-bg: transparent; --btn-color: var(--tf-tinta); }
.tf-btn--linea:hover { --btn-bg: var(--tf-azul); --btn-color: #fff; }
.tf-btn--claro { --btn-bg: #fff; --btn-color: var(--tf-azul); --btn-borde: #fff; }
.tf-btn--fantasma {
  --btn-bg: transparent; --btn-color: #fff; --btn-borde: rgba(255, 255, 255, .4);
}
.tf-btn--fantasma:hover { --btn-bg: rgba(255, 255, 255, .12); --btn-borde: #fff; box-shadow: none; }
.tf-btn--neutro { --btn-bg: var(--tf-blanco); --btn-color: var(--tf-tinta-2); --btn-borde: var(--tf-borde-fuerte); }
.tf-btn--neutro:hover { --btn-borde: var(--tf-azul); --btn-color: var(--tf-azul); box-shadow: var(--tf-s-sm); }
.tf-btn--peligro { --btn-bg: var(--tf-error); --btn-borde: var(--tf-error); }
.tf-btn--peligro:hover { box-shadow: 0 10px 26px rgba(224, 49, 49, .28); }
.tf-btn--ok { --btn-bg: var(--tf-ok); --btn-borde: var(--tf-ok); }
.tf-btn--ok:hover { box-shadow: 0 10px 26px rgba(16, 163, 127, .28); }

.tf-btn--sm { font-size: 13.5px; padding: 8px 16px; border-width: 1.5px; }
.tf-btn--xs { font-size: 12.5px; padding: 6px 12px; border-width: 1.5px; border-radius: 4px; }
.tf-btn--lg { font-size: 16.5px; padding: 16px 34px; }
.tf-btn--bloque { width: 100%; }
.tf-btn--icono { padding: 8px; width: 34px; height: 34px; border-radius: var(--tf-r-xs); }

/* -------------------------------- Insignias ------------------------------ */

.tf-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
  padding: 4px 11px; border-radius: var(--tf-r-full);
  background: var(--tf-neutro-bg); color: var(--tf-tinta-2); white-space: nowrap;
}
.tf-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.tf-badge--ok { background: var(--tf-ok-bg); color: var(--tf-ok); }
.tf-badge--aviso { background: var(--tf-aviso-bg); color: var(--tf-aviso); }
.tf-badge--error { background: var(--tf-error-bg); color: var(--tf-error); }
.tf-badge--info { background: var(--tf-info-bg); color: var(--tf-info); }
.tf-badge--liso::before { display: none; }

/* -------------------------------- Tarjetas ------------------------------- */

.tf-tarjeta {
  background: var(--tf-blanco);
  border: 1px solid var(--tf-borde);
  border-radius: var(--tf-r-md);
  box-shadow: var(--tf-s-xs);
}
.tf-tarjeta--flotante { box-shadow: var(--tf-s-md); border-color: transparent; }
.tf-tarjeta__cab {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--tf-borde);
}
.tf-tarjeta__cab h3 { margin: 0; font-size: 1.02rem; }
.tf-tarjeta__cuerpo { padding: 22px; }

/* -------------------------------- Formulario ----------------------------- */

.tf-campo { margin-bottom: 18px; }
.tf-campo:last-child { margin-bottom: 0; }
.tf-etiqueta {
  display: block; margin-bottom: 7px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px; color: var(--tf-tinta-2);
}
.tf-etiqueta .req { color: var(--tf-error); margin-left: 2px; }
.tf-pista { display: block; margin-top: 6px; font-size: 12px; color: var(--tf-suave); line-height: 1.5; }

.tf-input, .tf-select, .tf-area {
  width: 100%; font-family: inherit; font-size: 14.5px; color: var(--tf-tinta);
  background: var(--tf-blanco);
  border: 1.5px solid var(--tf-borde);
  border-radius: var(--tf-r-xs);
  padding: 11px 14px;
  transition: border-color var(--tf-trans), box-shadow var(--tf-trans), background var(--tf-trans);
  appearance: none;
}
.tf-area { min-height: 96px; resize: vertical; line-height: 1.6; }
.tf-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6b78' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.tf-input:hover, .tf-select:hover, .tf-area:hover { border-color: var(--tf-borde-fuerte); }
.tf-input:focus, .tf-select:focus, .tf-area:focus {
  outline: none; border-color: var(--tf-azul); box-shadow: 0 0 0 4px rgba(8, 106, 216, .12);
}
.tf-input::placeholder, .tf-area::placeholder { color: #a9b6c2; }
.tf-input:disabled, .tf-select:disabled, .tf-area:disabled { background: var(--tf-fondo); color: var(--tf-suave); cursor: not-allowed; }
.tf-input[aria-invalid="true"], .tf-select[aria-invalid="true"] { border-color: var(--tf-error); }
.tf-input--num { text-align: right; font-variant-numeric: tabular-nums; }

.tf-input-grupo { display: flex; align-items: stretch; }
.tf-input-grupo .tf-input { border-radius: var(--tf-r-xs) 0 0 var(--tf-r-xs); }
.tf-input-grupo__sufijo {
  display: inline-flex; align-items: center; padding: 0 13px;
  background: var(--tf-fondo); border: 1.5px solid var(--tf-borde); border-left: 0;
  border-radius: 0 var(--tf-r-xs) var(--tf-r-xs) 0;
  font-size: 13px; font-weight: 600; color: var(--tf-suave);
}

.tf-check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.tf-check input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--tf-azul); cursor: pointer; flex-shrink: 0; }

.tf-fila { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tf-fila--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tf-fila--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --------------------------------- Tablas -------------------------------- */

.tf-tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tf-tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tf-tabla thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--tf-fondo);
  padding: 11px 14px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase;
  color: var(--tf-suave); border-bottom: 1px solid var(--tf-borde);
}
.tf-tabla tbody td { padding: 13px 14px; border-bottom: 1px solid var(--tf-borde); vertical-align: middle; }
.tf-tabla tbody tr { transition: background var(--tf-trans); }
.tf-tabla tbody tr:hover { background: var(--tf-fondo-2); }
.tf-tabla tbody tr.clicable { cursor: pointer; }
.tf-tabla .r { text-align: right; }
.tf-tabla .c { text-align: center; }
.tf-tabla__vacia { padding: 54px 20px; text-align: center; color: var(--tf-suave); }

/* --------------------------------- Avisos -------------------------------- */

.tf-aviso {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--tf-r-sm); font-size: 14px; line-height: 1.6;
  background: var(--tf-info-bg); color: var(--tf-tinta-2);
  border-left: 3px solid var(--tf-azul);
}
.tf-aviso--ok { background: var(--tf-ok-bg); border-left-color: var(--tf-ok); }
.tf-aviso--aviso { background: var(--tf-aviso-bg); border-left-color: var(--tf-aviso); }
.tf-aviso--error { background: var(--tf-error-bg); border-left-color: var(--tf-error); }

/* --------------------------------- Utils --------------------------------- */

.tf-oculto { display: none !important; }
.tf-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tf-flex { display: flex; }
.tf-flex-centro { display: flex; align-items: center; }
.tf-entre { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tf-gap-6 { gap: 6px; } .tf-gap-8 { gap: 8px; } .tf-gap-12 { gap: 12px; } .tf-gap-16 { gap: 16px; }
.tf-mt-0 { margin-top: 0; } .tf-mt-8 { margin-top: 8px; } .tf-mt-16 { margin-top: 16px; } .tf-mt-24 { margin-top: 24px; }
.tf-mb-0 { margin-bottom: 0; } .tf-mb-8 { margin-bottom: 8px; } .tf-mb-16 { margin-bottom: 16px; } .tf-mb-24 { margin-bottom: 24px; }
.tf-envoltura { flex-wrap: wrap; }
.tf-crece { flex: 1 1 auto; min-width: 0; }
.tf-truncar { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-derecha { text-align: right; }
.tf-centro { text-align: center; }

@keyframes tf-aparecer { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tf-girar { to { transform: rotate(360deg); } }
@keyframes tf-pulso { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.tf-aparecer { animation: tf-aparecer .5s var(--tf-trans) both; }

.tf-cargador {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: tf-girar .7s linear infinite;
}
.tf-cargador--azul { border-color: rgba(8, 106, 216, .2); border-top-color: var(--tf-azul); }

.tf-esqueleto {
  background: linear-gradient(90deg, #eef2f7 25%, #f7fafd 50%, #eef2f7 75%);
  background-size: 200% 100%; border-radius: var(--tf-r-xs);
  animation: tf-brillo 1.3s ease-in-out infinite;
}
@keyframes tf-brillo { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 991px) {
  .tf-rejilla--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-rejilla--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .tf-contenedor { padding: 0 18px; }
  .tf-rejilla--2, .tf-rejilla--3, .tf-rejilla--4 { grid-template-columns: 1fr; }
  .tf-fila--2, .tf-fila--3 { grid-template-columns: 1fr; }
}
