/* Sinia Analítica: misma familia visual que siniadigital.com */
@font-face { font-family: "Switzer"; src: url("fonts/switzer-400.e23161fd661d.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-500.a7cfda8e3222.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geistmono-400.c9c1cc18a772.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --paper: oklch(98.2% 0.006 85); --paper-2: oklch(95.6% 0.014 82); --paper-3: oklch(92.4% 0.02 80);
  --card: oklch(99.6% 0.003 85);
  --ink: oklch(24% 0.04 245); --ink-2: oklch(37% 0.035 245); --muted: oklch(48% 0.025 245); --muted-2: oklch(60% 0.018 245);
  --rule: oklch(89% 0.012 80); --rule-2: oklch(93% 0.009 80);
  --accent: oklch(52% 0.11 205); --accent-hi: oklch(46% 0.11 205); --accent-soft: oklch(94% 0.035 200); --accent-track: oklch(92% 0.03 205);
  --warm: oklch(76% 0.15 60); --warm-soft: oklch(94% 0.04 60);
  --up: oklch(50% 0.12 150); --down: oklch(52% 0.16 27);
  --field: oklch(27% 0.06 240); --field-ink: oklch(96% 0.01 220);
  --focus: oklch(55% 0.14 205);
  --shadow: 0 1px 2px oklch(24% 0.04 245 / 0.05), 0 6px 20px oklch(24% 0.04 245 / 0.05);
  --font: "Switzer", ui-sans-serif, system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
  --r-card: 14px; --r-inner: 8px; --r-pill: 999px;
  --s-2xs: 4px; --s-xs: 8px; --s-sm: 12px; --s-md: 16px; --s-lg: 24px; --s-xl: 40px; --s-2xl: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: oklch(19% 0.025 245); --paper-2: oklch(23% 0.03 245); --paper-3: oklch(28% 0.03 245);
    --card: oklch(22% 0.028 245);
    --ink: oklch(95% 0.01 85); --ink-2: oklch(85% 0.015 85); --muted: oklch(72% 0.02 240); --muted-2: oklch(60% 0.02 240);
    --rule: oklch(32% 0.03 245); --rule-2: oklch(27% 0.028 245);
    --accent: oklch(72% 0.11 205); --accent-hi: oklch(80% 0.1 205); --accent-soft: oklch(30% 0.05 205); --accent-track: oklch(30% 0.04 215);
    --warm-soft: oklch(32% 0.05 60);
    --up: oklch(76% 0.13 150); --down: oklch(74% 0.14 27);
    --field: oklch(14% 0.03 245);
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--s-xl); }
@media (max-width: 720px) { .wrap { padding: 0 var(--s-md); } }

/* Barra superior */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--paper) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule-2); }
.top__in { display: flex; align-items: center; gap: var(--s-lg); height: 64px; }
.marca { display: flex; align-items: baseline; gap: 6px; text-decoration: none; font-weight: 500; letter-spacing: -0.02em; font-size: 1.125rem; white-space: nowrap; }
.marca span { color: var(--accent); }
.nav { display: flex; gap: var(--s-2xs); margin: 0; padding: 0; list-style: none; }
.nav a { display: block; padding: 6px 14px; border-radius: var(--r-pill); text-decoration: none; color: var(--muted); font-size: 0.9375rem; transition: background .2s var(--ease), color .2s var(--ease); }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper-3); }
.top__salir { margin-left: auto; }
.btn-texto { font: inherit; font-size: 0.875rem; color: var(--muted); background: none; border: 0; padding: 6px 4px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
.btn-texto:hover { color: var(--ink); }
@media (max-width: 640px) {
  .top__in { flex-wrap: wrap; height: auto; padding-block: var(--s-sm); row-gap: var(--s-xs); }
  .nav { order: 3; width: 100%; }
}

/* Cabecera de página y filtros */
.cab { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-md) var(--s-lg); padding: var(--s-xl) 0 var(--s-lg); }
.cab h1 { font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem); letter-spacing: -0.035em; line-height: 1.1; }
.cab__sub { margin: 6px 0 0; color: var(--muted); }
.vivo { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--rule-2); font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; }
.vivo__punto { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.vivo--on .vivo__punto { background: var(--up); box-shadow: 0 0 0 0 color-mix(in oklab, var(--up) 50%, transparent); animation: latido 2s infinite; }
@keyframes latido { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .vivo--on .vivo__punto { animation: none; } }

.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-sm); padding-bottom: var(--s-lg); border-bottom: 1px solid var(--rule-2); margin-bottom: var(--s-lg); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--rule-2); overflow-x: auto; max-width: 100%; }
.seg a { padding: 6px 14px; border-radius: var(--r-pill); text-decoration: none; font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a[aria-current="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px oklch(24% 0.04 245 / 0.12); }
.campo { font: inherit; font-size: 0.875rem; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-pill); padding: 7px 14px; min-height: 36px; }
select.campo { padding-right: 34px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 17px top 50%, right 12px top 50%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 100%; }
.fechas { position: relative; }
.fechas summary { list-style: none; cursor: pointer; }
.fechas summary::-webkit-details-marker { display: none; }
.fechas[open] summary, .fechas--on summary { border-color: var(--accent); color: var(--ink); }
.fechas__panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; display: grid; gap: var(--s-sm); padding: var(--s-md); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-card); box-shadow: var(--shadow); min-width: 260px; }
.fechas__panel label { display: grid; gap: 4px; font-size: 0.8125rem; color: var(--muted); }
.btn { font: inherit; font-size: 0.875rem; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-hi); }
.btn--suave { background: var(--card); color: var(--ink); border-color: var(--rule); }
.btn--suave:hover { background: var(--paper-2); }

/* Tarjetas */
.tarjeta { background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--s-lg); min-width: 0; }
.tarjeta__cab { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-sm); margin-bottom: var(--s-md); }
.tarjeta__cab h2 { font-size: 1.0625rem; }
.tarjeta__cab p { margin: 0; font-size: 0.8125rem; color: var(--muted); }

/* Cifras */
.cifras { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: var(--s-md); margin-bottom: var(--s-md); }
@media (max-width: 960px) { .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .cifras { grid-template-columns: minmax(0, 1fr); } }
.cifra { display: grid; align-content: start; gap: 6px; }
.cifra__et { font-size: 0.875rem; color: var(--muted); }
.cifra__valor { font-size: 2.25rem; font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; }
.cifra--hero { background: var(--field); border-color: var(--field); color: var(--field-ink); }
.cifra--hero .cifra__et, .cifra--hero .cifra__nota { color: color-mix(in oklab, var(--field-ink) 72%, transparent); }
.cifra--hero .cifra__valor { font-size: 3.25rem; }
.cifra__pie { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.8125rem; }
.cifra__nota { color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.delta svg { width: 14px; height: 14px; }
.delta--sube { color: var(--up); }
.delta--baja { color: var(--down); }
.delta--igual { color: var(--muted); }
.cifra--hero .delta--sube { color: oklch(82% 0.13 150); }
.cifra--hero .delta--baja { color: oklch(80% 0.12 27); }

/* Gráfico */
.grafico { position: relative; height: 280px; }
.grafico svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grafico .eje { font: 12px/1 var(--font); fill: var(--muted); font-variant-numeric: tabular-nums; }
.grafico .rejilla { stroke: var(--rule-2); stroke-width: 1; shape-rendering: crispEdges; }
.grafico .base { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.grafico .col { fill: var(--accent); }
.grafico .col--hover { fill: var(--accent-hi); }
.grafico .banda { fill: transparent; cursor: default; }
.grafico .banda--hover { fill: color-mix(in oklab, var(--accent) 8%, transparent); }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 10px 12px; border-radius: var(--r-inner); background: var(--ink); color: var(--paper); font-size: 0.8125rem; line-height: 1.4; box-shadow: 0 8px 24px oklch(0% 0 0 / 0.18); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tip--on { opacity: 1; transform: none; }
.tip strong { display: block; margin-bottom: 4px; font-weight: 500; }
.tip__fila { display: flex; justify-content: space-between; gap: 16px; }
.tip__fila span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }
.tip__marca { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 6px; }
.vacio { display: grid; place-items: center; height: 100%; min-height: 120px; color: var(--muted); font-size: 0.9375rem; text-align: center; }
.tabla-datos { margin-top: var(--s-md); font-size: 0.875rem; }
.tabla-datos summary { cursor: pointer; color: var(--muted); }
.tabla-datos table { width: 100%; border-collapse: collapse; margin-top: var(--s-sm); }
.tabla-datos th, .tabla-datos td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
.tabla-datos td:not(:first-child), .tabla-datos th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* Rejilla de listas */
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-md); margin-top: var(--s-md); }
.rejilla--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .rejilla--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .rejilla, .rejilla--4 { grid-template-columns: minmax(0, 1fr); } }

.lista { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-sm); row-gap: 6px; align-items: baseline; }
.lista__nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; color: var(--ink); }
.lista__nombre a { text-decoration: none; }
.lista__nombre a:hover { text-decoration: underline; text-decoration-color: var(--rule); }
.lista__detalle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--muted); }
.lista__n { font-size: 0.9375rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.lista__barra { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--accent-track); overflow: hidden; }
.lista__barra i { display: block; height: 100%; min-width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.lista--evento .lista__barra { background: var(--warm-soft); }
.lista--evento .lista__barra i { background: var(--warm); }
.lista__marca { display: inline-flex; align-items: center; gap: 8px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); font-size: 0.75rem; font-weight: 500; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule-2); }
.chip--whatsapp { background: color-mix(in oklab, oklch(62% 0.15 150) 14%, var(--card)); border-color: transparent; }
.chip--propuesta { background: var(--accent-soft); border-color: transparent; }
.chip--warm { background: var(--warm-soft); border-color: transparent; }

/* Propuestas */
.tabla { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.tabla thead th { text-align: left; font-weight: 500; font-size: 0.8125rem; color: var(--muted); padding: 0 var(--s-sm) var(--s-sm); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tabla td, .tabla tbody th { padding: 14px var(--s-sm); border-bottom: 1px solid var(--rule-2); vertical-align: middle; text-align: left; font-weight: 400; }
.tabla tr > :first-child { padding-left: 0; }
.tabla tr > :last-child { padding-right: 0; }
.tabla .n { text-align: right; font-variant-numeric: tabular-nums; }
.tabla thead .n { text-align: right; }
.tabla tbody tr { transition: background .15s; }
.tabla tbody tr:hover { background: var(--paper-2); }
.prop__nombre { display: block; font-weight: 500; color: var(--ink); text-decoration: none; }
.prop__nombre:hover { text-decoration: underline; text-decoration-color: var(--rule); }
.prop__host { display: block; font-size: 0.8125rem; color: var(--muted); }
.cero { color: var(--muted-2); }
.reciente { display: inline-flex; align-items: center; gap: 6px; }
.reciente::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.ir { white-space: nowrap; font-size: 0.875rem; color: var(--muted); text-decoration: none; }
.ir:hover { color: var(--accent-hi); }
@media (max-width: 860px) {
  .tabla thead { display: none; }
  .tabla tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px var(--s-sm); padding: var(--s-md) 0; border-bottom: 1px solid var(--rule-2); }
  .tabla td, .tabla tbody th { padding: 0; border: 0; text-align: left !important; }
  .tabla tbody th { grid-column: 1 / -1; }
  .tabla td[data-et]::before { content: attr(data-et); display: block; font-size: 0.75rem; color: var(--muted); }
  .tabla td.ir-celda { grid-column: 1 / -1; }
}

/* Formularios y avisos */
.form { display: grid; gap: var(--s-md); max-width: 380px; }
.form label { display: grid; gap: 6px; font-size: 0.875rem; color: var(--ink-2); }
.form input { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-inner); padding: 10px 12px; }
.form input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.error { margin: 0; padding: 10px 12px; border-radius: var(--r-inner); background: color-mix(in oklab, var(--down) 12%, var(--card)); color: var(--ink); font-size: 0.875rem; }
.aviso { margin: 0 0 var(--s-md); padding: 10px 14px; border-radius: var(--r-inner); background: color-mix(in oklab, var(--up) 14%, var(--card)); font-size: 0.9375rem; }
.ayuda { color: var(--muted); font-size: 0.875rem; margin: 0; }
.pila { display: grid; gap: var(--s-md); }
.ajustes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-md); align-items: start; }
@media (max-width: 860px) { .ajustes { grid-template-columns: minmax(0, 1fr); } }
code { font-family: var(--mono); font-size: 0.85em; background: var(--paper-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* Entrada */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: var(--s-lg); background: radial-gradient(1200px 600px at 80% -10%, var(--accent-soft), transparent 60%), var(--paper); }
.entrar__caja { width: 100%; max-width: 400px; }
.entrar__caja .marca { font-size: 1.375rem; margin-bottom: var(--s-xs); display: inline-flex; }
.entrar__caja h1 { font-size: 2rem; letter-spacing: -0.035em; margin-bottom: var(--s-xs); }
.entrar__caja .tarjeta { padding: var(--s-xl) var(--s-lg); }
.entrar__caja .btn { width: 100%; padding: 12px; font-size: 1rem; }

.pie { padding: var(--s-2xl) 0 var(--s-xl); color: var(--muted-2); font-size: 0.8125rem; }
.pie a { color: var(--muted); }
