:root {
  --bg: #ffffff;
  --ink: #1d2530;
  --muted: #6b7480;
  --line: #e4e7eb;          /* fino, gris claro */
  --line-strong: #d7dbe0;
  --radius: 12px;
  --pos: #0F6E56;
  --neg: #A32D2D;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- HEADER ---------- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  background: var(--bg);
  border-bottom: 0.5px solid var(--line-strong);
  padding: 16px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: #1d2530; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
}
.brand-text, .client-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 600; }
.brand-sub, .client-sub { color: var(--muted); font-size: 13px; }
.client { display: flex; align-items: center; gap: 14px; }
.client-text { text-align: right; }
.client-name { font-weight: 600; }
.period-select {
  border: 0.5px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; background: #fff; color: var(--ink); font-size: 14px;
  cursor: pointer;
}

/* ---------- LAYOUT ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 24px; }
.card {
  background: var(--bg);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card-title { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.section-title { margin: 8px 0 14px; font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- KPI CARDS ---------- */
.kpi-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px;
}
.kpi-card {
  background: var(--bg); border: 0.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
  cursor: default; transition: border-color .15s ease;
}
.kpi-card:hover { border-color: var(--line-strong); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.kpi-delta { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.kpi-delta .arrow { font-size: 11px; }
.kpi-delta.good { color: var(--pos); }
.kpi-delta.bad { color: var(--neg); }

/* ---------- LEGENDS / CHARTS ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.legend-item b { color: var(--ink); }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-box { position: relative; height: 300px; }
.donut-box { height: 260px; }

/* ---------- FUNNEL ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-stage { display: flex; align-items: center; gap: 12px; cursor: default; }
.funnel-bar {
  height: 38px; border-radius: 8px; display: flex; align-items: center;
  padding: 0 12px; min-width: 0; transition: filter .15s ease, transform .15s ease;
}
.funnel-stage:hover .funnel-bar { filter: brightness(1.06); transform: translateX(2px); }
.funnel-label { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-value { font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ---------- TABLE ---------- */
.table-wrap { overflow-x: auto; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table th, .detail-table td { padding: 12px 10px; border-bottom: 0.5px solid var(--line); text-align: left; white-space: nowrap; }
.detail-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.detail-table td.num, .detail-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.detail-table tbody tr { transition: background .12s ease; }
.detail-table tbody tr:hover { background: #f5f7fa; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle; }

/* ---------- ACTIVITY ---------- */
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.activity li { display: flex; align-items: flex-start; gap: 10px; }
.check {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: #e6f4ef; color: var(--pos); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.site-footer { color: var(--muted); font-size: 12px; text-align: center; padding: 12px 0 4px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 880px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { padding: 16px; }
  .site-header { padding: 14px 16px; }
  .client { width: 100%; justify-content: space-between; }
  .kpi-value { font-size: 22px; }
}
