/* ============================================================
   XFLOWD Connect — hoja de estilos
   Construida sobre el XFLOWD UI Kit. Los tokens de :root son los
   oficiales: no inventar colores, radios ni tipografías fuera de acá.

   ♿ ACCESIBILIDAD — regla no negociable de este proyecto:
   ningún estado se comunica SOLO con color. Cada badge lleva
   ícono + texto, porque Mati es daltónico y porque un correo
   impreso o una pantalla mala igual tienen que leerse.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Marca */
  --color-primary:      #06697E;
  --color-primary-deep: #054F5F;
  --color-primary-500:  #00818B;
  --color-primary-tint: #E6F0F2;
  --color-navy-ink:     #0F2138;

  /* Semánticos */
  --color-success: #10B981;
  --color-error:   #EF4444;
  --color-bg:      #F3F4F6;

  /* Grises de apoyo */
  --gris-borde:  #E2E8F0;
  --gris-texto:  #64748B;
  --gris-suave:  #F8FAFC;

  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --sombra:    0 1px 3px rgba(15,33,56,.06), 0 1px 2px rgba(15,33,56,.04);
  --sombra-md: 0 4px 24px rgba(15,33,56,.10), 0 1px 4px rgba(15,33,56,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--color-navy-ink);
  background: var(--color-bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary-500); }

/* ── Marca ──────────────────────────────────────────────────── */
/* La marca manda: barra oscura, logo grande, nada compitiendo al lado. */
.topbar {
  background: var(--color-navy-ink);
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-logo { height: 30px; width: auto; display: block; }
.topbar-sep  { width: 1px; height: 26px; background: rgba(255,255,255,.18); }
.topbar-titulo {
  font-size: 15px; font-weight: 600; color: #fff; letter-spacing: .2px;
}
.topbar-sub { font-size: 12px; color: #94A3B8; margin-top: -2px; }
.topbar-derecha { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-usuario { font-size: 13px; color: #CBD5E1; font-weight: 500; }
.topbar-link {
  font-size: 13px; font-weight: 600; color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: var(--radius-full);
  background: rgba(255,255,255,.10);
}
.topbar-link:hover { background: rgba(255,255,255,.18); }

/* Marca en pantallas de acceso: el logo es el protagonista absoluto */
.marca-hero { text-align: center; margin-bottom: 32px; }
.marca-hero img { height: 46px; width: auto; margin: 0 auto 18px; display: block; }
.marca-hero .campana {
  display: inline-block;
  background: var(--color-primary-tint);
  color: var(--color-primary-deep);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 6px 14px; border-radius: var(--radius-full);
}

/* ── Estructura ─────────────────────────────────────────────── */
.centrado {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px 20px;
}
.contenedor { max-width: 1180px; margin: 0 auto; padding: 28px; }
.contenedor-angosto { max-width: 720px; margin: 0 auto; padding: 28px 20px; }

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sombra-md);
  padding: 40px;
  width: 100%;
  max-width: 460px;
}
.panel {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--sombra);
  padding: 24px;
  margin-bottom: 20px;
}
.panel-titulo {
  font-size: 16px; font-weight: 700; color: var(--color-navy-ink);
  margin-bottom: 4px; display: flex; align-items: center; gap: 8px;
}
.panel-sub { font-size: 13px; color: var(--gris-texto); margin-bottom: 20px; }

h1 { font-size: 28px; line-height: 34px; font-weight: 700; }
h2 { font-size: 20px; line-height: 28px; font-weight: 700; }
.titulo-pagina { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.sub-pagina { font-size: 14px; color: var(--gris-texto); margin-bottom: 24px; }

/* ── Formularios ────────────────────────────────────────────── */
.campo { margin-bottom: 18px; }
label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--color-navy-ink); margin-bottom: 7px;
}
label .opcional { color: var(--gris-texto); font-weight: 500; text-transform: none; letter-spacing: 0; }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font); font-size: 15px;
  color: var(--color-navy-ink);
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-md);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
}
input[aria-invalid="true"] { border-color: var(--color-error); }
.ayuda { font-size: 12px; color: var(--gris-texto); margin-top: 6px; }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--gris-suave); border: 1px solid var(--gris-borde);
  border-radius: var(--radius-md); padding: 14px; margin-bottom: 14px;
}
.check input { margin-top: 3px; flex-shrink: 0; width: 17px; height: 17px; accent-color: var(--color-primary-500); }
.check label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; margin: 0; line-height: 1.5; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Código de 6 dígitos */
.input-codigo {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 30px; font-weight: 700;
  letter-spacing: 12px; text-align: center;
  padding: 16px 14px 16px 26px;
}

/* ── Botones (pill, según el UI Kit) ────────────────────────── */
.btn {
  font-family: var(--font); font-weight: 600; font-size: 15px;
  border: none; border-radius: var(--radius-full);
  padding: 12px 24px; cursor: pointer; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--color-primary-500); color: #fff; }
.btn-primary:hover { background: var(--color-primary-deep); }
.btn-primary:disabled { background: var(--color-primary-tint); color: var(--color-primary-500); cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--color-navy-ink); border: 1px solid #D1D5DB; }
.btn-outline:hover { background: var(--gris-suave); }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger-outline { background: transparent; color: var(--color-error); border: 1px solid var(--color-error); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ── Badges de estado ───────────────────────────────────────── */
/* ♿ SIEMPRE ícono + texto. El color es refuerzo, nunca el único canal. */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--radius-full);
  padding: 4px 12px; font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.badge-neutro   { background: #E5E7EB; color: #1F2937; }
.badge-espera   { background: #FEF9C3; color: #A16207; }
.badge-ok       { background: #DCFCE7; color: #15803D; }
.badge-error    { background: #FEE2E2; color: #B91C1C; }
.badge-info     { background: var(--color-primary-tint); color: var(--color-primary-deep); }
.badge-premio   { background: #FFEDD5; color: #C2410C; }

/* ── Tablas ─────────────────────────────────────────────────── */
.tabla-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.tabla thead th {
  background: var(--gris-suave);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--gris-texto); text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--gris-borde);
  white-space: nowrap;
}
table.tabla tbody td { padding: 13px 14px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
table.tabla tbody tr:hover { background: #FAFBFC; }
table.tabla tbody tr:last-child td { border-bottom: none; }
.tabla-vacia { padding: 48px 24px; text-align: center; color: var(--gris-texto); }
.tabla-vacia .emoji { font-size: 36px; display: block; margin-bottom: 10px; }

/* ── Avisos ─────────────────────────────────────────────────── */
.aviso {
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 18px;
  font-size: 14px; display: flex; gap: 10px; align-items: flex-start;
  border-left: 4px solid;
}
.aviso-ok    { background: #F0FDF4; border-color: var(--color-success); color: #166534; }
.aviso-error { background: #FEF2F2; border-color: var(--color-error); color: #991B1B; }
.aviso-info  { background: var(--color-primary-tint); border-color: var(--color-primary-500); color: var(--color-primary-deep); }
.aviso-alerta{ background: #FFFBEB; border-color: #F59E0B; color: #92400E; }

/* ── KPIs ───────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: #fff; border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--sombra); }
.kpi-valor { font-size: 28px; font-weight: 800; color: var(--color-navy-ink); line-height: 1.1; }
.kpi-label { font-size: 12px; color: var(--gris-texto); font-weight: 600; margin-top: 4px; }

/* ── Línea de tiempo ────────────────────────────────────────── */
.timeline { list-style: none; position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--gris-borde);
}
.timeline li { position: relative; padding-bottom: 20px; }
.timeline li::before {
  content: ''; position: absolute; left: -23px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-primary-500); box-shadow: 0 0 0 3px #fff;
}
.timeline .t-titulo { font-weight: 600; font-size: 14px; }
.timeline .t-fecha  { font-size: 12px; color: var(--gris-texto); }
.timeline .t-detalle{ font-size: 13px; color: var(--gris-texto); margin-top: 3px; }

/* ── Navegación interna ─────────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600; color: var(--gris-texto);
  text-decoration: none; background: #fff; box-shadow: var(--sombra);
}
.tab:hover { color: var(--color-navy-ink); }
.tab.activo { background: var(--color-navy-ink); color: #fff; }

.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filtros .campo { margin-bottom: 0; }
.filtros select, .filtros input { min-width: 160px; }

/* ── Pie ────────────────────────────────────────────────────── */
.pie {
  text-align: center; font-size: 12px; color: #94A3B8;
  padding: 28px 20px; line-height: 1.7;
}
.pie a { color: var(--gris-texto); }

.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.txt-gris { color: var(--gris-texto); }
.txt-sm { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ── Chips de selección múltiple ─────────────────────────────── */
/* Para el tipo de centro: muchos son híbridos, así que se marcan varios.
   Un <select multiple> es un desastre en móvil; estos chips no. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* El chip ES un <label>, así que hay que anular el uppercase y el espaciado
   que llevan los labels de formulario: en un nombre largo como «Gimnasio
   tradicional (musculación / máquinas)» resultaba ilegible. */
.chip {
  position: relative; cursor: pointer;
  text-transform: none; letter-spacing: normal;
  font-size: 13px; font-weight: 500; margin-bottom: 0;
  display: inline-block;
}
.chip input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.chip span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  background: #fff; color: var(--color-navy-ink);
  transition: all .12s;
  user-select: none;
}
.chip:hover span { border-color: var(--color-primary-500); }
/* ♿ El estado marcado no depende solo del color: cambia el fondo, el borde,
   el peso de la letra y agrega un ✓ delante. */
.chip input:checked + span {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
  color: #fff; font-weight: 600;
}
.chip input:checked + span::before { content: '✓ '; }
.chip input:focus-visible + span {
  outline: 2px solid var(--color-primary-500); outline-offset: 2px;
}

/* ── Documento legal (T&C, bases) ────────────────────────────── */
.documento { line-height: 1.7; }
.documento h3 {
  font-size: 16px; font-weight: 700; margin: 24px 0 8px;
  color: var(--color-navy-ink);
}
.documento h3:first-child { margin-top: 0; }
.documento p { margin-bottom: 12px; }
.documento ul, .documento ol { margin: 0 0 12px 20px; }
.documento li { margin-bottom: 6px; }

/* ── Fila de filtros por fecha ───────────────────────────────── */
.filtro-fechas {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  background: var(--gris-suave); border: 1px solid var(--gris-borde);
  border-radius: var(--radius-lg); padding: 14px; margin-bottom: 18px;
}
.filtro-fechas .campo { margin-bottom: 0; }
.filtro-fechas input[type=date] { min-width: 150px; }

/* ── Separador con texto ─────────────────────────────────────── */
.separador {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 16px;
  color: var(--gris-texto); font-size: 12px; font-weight: 600;
}
.separador::before, .separador::after {
  content: ''; flex: 1; height: 1px; background: var(--gris-borde);
}

/* ── Monto con formato ───────────────────────────────────────── */
/* El campo se muestra como $100.000 y se envía como número limpio. */
.input-monto {
  font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Tablas dentro de un documento legal ─────────────────────── */
/* Word aplana las tablas al exportar a .txt; el importador las rearma. */
.documento .tabla-doc {
  width: 100%; border-collapse: collapse; margin: 0 0 18px;
  font-size: 14px;
}
.documento .tabla-doc th {
  text-align: left; padding: 10px 12px;
  background: var(--gris-suave); border-bottom: 1px solid var(--gris-borde);
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--gris-texto);
}
.documento .tabla-doc td {
  padding: 10px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: top;
}
.documento .tabla-doc td:first-child { width: 32%; color: var(--gris-texto); }
