/* ————————————————————————————————————————
   Inversión publicitaria · Jacri Seguridad
   Estilo editorial sobrio: papel, tinta, filetes.
———————————————————————————————————————— */

:root {
  --paper:      #f7f4ee;
  --ink:        #16140f;
  --ink-soft:   #57534a;
  --ink-faint:  #8a857a;
  --rule:       #ddd7ca;
  --rule-dark:  #b8b2a4;
  --accent:     #1e4d3b;   /* verde botella */
  --accent-dim: #6f9b8a;
  --neg:        #8c2f2f;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, "Segoe UI", sans-serif;
}

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

html { font-size: 16px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ——— Barra superior ——— */
.topbar { border-bottom: 1px solid var(--ink); }
.topbar-inner {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 14px; padding-bottom: 12px;
}
.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}
.updated {
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ——— Cabecera editorial ——— */
.masthead {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--rule);
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.lede {
  margin-top: 14px;
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 560px;
}

/* ——— KPIs ——— */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule);
}
.kpi {
  padding: 28px 24px 30px 0;
  border-right: 1px solid var(--rule);
}
.kpi + .kpi { padding-left: 24px; }
.kpi:last-child { border-right: 0; }
.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.kpi-value {
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.125rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.kpi-sub {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ——— Paneles ——— */
.panel { padding: 40px 0 8px; }
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 20px;
}
.panel-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}

/* Leyenda */
.legend { display: flex; gap: 18px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.75rem; color: var(--ink-soft);
}
.sw { width: 18px; height: 2px; display: inline-block; }
.sw-cost   { background: var(--ink); }
.sw-clicks { background: var(--accent-dim); }

/* Gráfica */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.axis-label {
  font-family: var(--sans);
  font-size: 10px;
  fill: var(--ink-faint);
  letter-spacing: 0.02em;
}
.grid-line { stroke: var(--rule); stroke-width: 1; }
.line-cost   { stroke: var(--ink); stroke-width: 1.75; fill: none; }
.line-clicks { stroke: var(--accent-dim); stroke-width: 1.5; fill: none; }
.area-cost { fill: var(--ink); opacity: 0.05; }
.dot { fill: var(--ink); }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  z-index: 5;
}
.chart-tip strong { font-weight: 600; }

/* ——— Tabla de campañas ——— */
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
thead th.num, td.num { text-align: right; }
thead th:last-child, td:last-child { padding-right: 0; }
tbody td {
  padding: 13px 14px 13px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.875rem;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 1px solid var(--rule-dark); }
td.col-name {
  font-weight: 500;
  white-space: normal;
  min-width: 170px;
  max-width: 260px;
}
.status {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.status.paused { color: var(--ink-faint); }
tfoot td {
  padding: 12px 12px 0 0;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
tfoot td:first-child { text-align: left; }

/* ——— Pie ——— */
.footer {
  margin-top: 48px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--rule);
}
.footer p {
  font-size: 0.75rem;
  color: var(--ink-faint);
  max-width: 520px;
}

/* Aviso datos de demostración */
.demo-note {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neg);
  border: 1px solid var(--neg);
  padding: 3px 8px;
}

/* ——— Responsive ——— */
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: 0; border-bottom: 1px solid var(--rule); padding-left: 0; }
  .kpi + .kpi { padding-left: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--rule); padding-left: 24px; }
  .kpi:nth-child(n+3) { border-bottom: 0; }
  .masthead { padding: 40px 0 32px; }
}

@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 1.375rem; }
}
