:root {
  --tinta: #1c1a2e;
  --tinta-2: #5c5648;
  --tenue: #8b8170;
  --panel: #15142a;
  --acento: #e0a96d;
  --acento-2: #c97b4a;
  --papel: #fffdf8;
  --rejilla: #ece6da;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: "Inter", system-ui, sans-serif; color: var(--tinta); background: #f4efe5; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; }

.cabecera { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--panel); color: #ece9f6; }
.marca { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: "Playfair Display", serif; font-size: 18px; font-weight: 600; }
.logo { width: 34px; height: 34px; display: grid; place-items: center; font-size: 21px; color: var(--panel); background: linear-gradient(135deg, var(--acento), var(--acento-2)); border-radius: 10px; }
.etiqueta { font-size: 13px; color: #a7a2bd; }

main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.fila-titulo { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
h1 { margin: 0; font-family: "Playfair Display", serif; font-size: 30px; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
.filtros { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tinta-2); }
.filtros input { padding: 7px 10px; border: 1px solid #00000020; border-radius: 9px; background: var(--papel); color: var(--tinta); }
.boton { padding: 8px 14px; border-radius: 9px; font-weight: 600; color: #1b1408; background: linear-gradient(135deg, var(--acento), var(--acento-2)); }
.estado { color: var(--tenue); }

.tarjetas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.tarjeta { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--papel); border-radius: 14px; box-shadow: 0 1px 2px #0000000d; }
.cifra { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rotulo { font-size: 13.5px; color: var(--tinta-2); }
.rotulo small { color: var(--tenue); }

.bloque { position: relative; margin-bottom: 18px; padding: 20px 22px; background: var(--papel); border-radius: 14px; box-shadow: 0 1px 2px #0000000d; }
.cabecera-bloque { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.segmentos { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #0000000a; }
.segmentos button { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--tinta-2); background: transparent; }
.segmentos button.activo { color: var(--tinta); background: var(--papel); box-shadow: 0 1px 2px #00000014; }

.grafico svg { display: block; width: 100%; height: 240px; overflow: visible; }
.grafico .rejilla { stroke: var(--rejilla); stroke-width: 1; }
.grafico .eje { fill: var(--tenue); font-size: 11px; font-variant-numeric: tabular-nums; }
.grafico .barra { fill: var(--acento-2); }
.grafico .zona:hover + .barra, .grafico .barra.resaltada { fill: #a85f33; }
.grafico .zona { fill: transparent; cursor: default; }
.grafico .vacio { fill: var(--tenue); font-size: 14px; }
.globo {
  position: absolute; pointer-events: none; padding: 8px 10px; border-radius: 9px; font-size: 13px; line-height: 1.4;
  color: #f4f1fb; background: var(--panel); box-shadow: 0 6px 20px #0003; white-space: nowrap; transform: translate(-50%, -100%);
}
.globo strong { display: block; font-weight: 600; }

.tabla-envoltorio { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--tinta-2); border-bottom: 1px solid var(--rejilla); cursor: pointer; user-select: none; white-space: nowrap; }
th.ordenada::after { content: " ↓"; color: var(--acento-2); }
th.ordenada.asc::after { content: " ↑"; }
td { padding: 9px 10px; border-bottom: 1px solid #f1ece2; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.correo { font-weight: 500; }
.secundario { display: block; font-size: 12px; color: var(--tenue); }
.punto { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #2f9e62; vertical-align: 1px; }
.pastilla { padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #0000000a; color: var(--tinta-2); }
.nota { margin: 14px 0 0; font-size: 12.5px; color: var(--tenue); }

@media (max-width: 800px) {
  .tarjetas { grid-template-columns: 1fr 1fr; }
  .cifra { font-size: 24px; }
}
