:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #6f6b64;
  --paper: #f7f2ea;
  --line: #ded6c8;
  --dark: #111111;
  --blue: #1672c9;
  --green: #27825d;
  --red: #c84c3e;
  --gold: #c9942f;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Outfit, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.hero {
  min-height: 500px;
  color: var(--white);
  background:
    linear-gradient(120deg, rgba(17, 17, 17, .94), rgba(17, 17, 17, .64)),
    repeating-linear-gradient(135deg, #1d1d1d 0 2px, #151515 2px 16px);
  padding: 28px clamp(18px, 4vw, 56px) 86px;
}

.topbar,
.hero-grid,
.dashboard {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  width: min(290px, 58vw);
  height: auto;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.24);
  padding: 10px 13px;
  font-size: 14px;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #44d07b;
  box-shadow: 0 0 0 5px rgba(68,208,123,.16);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(28px, 6vw, 80px);
  align-items: end;
  padding-top: 86px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.02;
}

h2 {
  font-size: 20px;
  font-weight: 700;
}

.hero-copy {
  max-width: 720px;
  margin: 28px 0 0;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.65;
}

.signal-panel {
  border: 1px solid rgba(255,255,255,.22);
  padding: 22px;
  background: rgba(255,255,255,.06);
}

.signal-panel span,
.signal-panel small {
  display: block;
  color: rgba(255,255,255,.72);
}

.signal-panel strong {
  display: block;
  margin: 4px 0;
  font-size: 64px;
  line-height: 1;
}

.dashboard {
  padding: 28px clamp(16px, 4vw, 56px) 52px;
}

.filters,
.kpis,
.content-grid {
  display: grid;
  gap: 16px;
}

.filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: -44px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(47, 38, 24, .12);
}

label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  background: #fbfaf7;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-size: 17px;
  text-transform: none;
}

.kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi,
.panel {
  background: var(--white);
  border: 1px solid var(--line);
}

.kpi {
  min-height: 134px;
  padding: 18px;
  min-width: 0;
  overflow: hidden;
}

.kpi span,
.kpi small {
  display: block;
  color: var(--muted);
}

.kpi span {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin: 10px 0 6px;
  max-width: 100%;
  font-size: clamp(25px, 2.05vw, 32px);
  font-weight: 700;
  line-height: 1.08;
  overflow-wrap: break-word;
}

.kpi strong[data-trend="up"] {
  color: var(--green);
}

.kpi strong[data-trend="down"] {
  color: var(--red);
}

.kpi.accent {
  background: var(--dark);
  color: var(--white);
}

.kpi.accent span,
.kpi.accent small {
  color: rgba(255,255,255,.7);
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.bar-list,
.ranking,
.legend,
.insights {
  display: grid;
  gap: 12px;
}

.timeline {
  min-height: 250px;
  display: grid;
  gap: 16px;
  padding-top: 12px;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trend-legend-item::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--type-color);
}

.trend-grid {
  min-height: 218px;
  display: grid;
  grid-template-columns: repeat(14, minmax(32px, 1fr));
  align-items: end;
  gap: 10px;
}

.trend-day {
  min-width: 0;
  height: 210px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  gap: 7px;
  text-align: center;
}

.trend-stack {
  width: 100%;
  min-height: 10px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  background: #eee7dc;
}

.trend-segment {
  display: block;
  min-height: 0;
}

.trend-day strong {
  color: var(--ink);
  font-size: 15px;
}

.trend-day span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.insights p {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid #eee7dc;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.insights p:last-child {
  border-bottom: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 128px 1fr 44px;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.bar-row strong {
  font-weight: 600;
}

.bar-track {
  height: 15px;
  background: #eee7dc;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
}

.bar-row:nth-child(2) .bar-fill,
.legend-item:nth-child(2)::before {
  background: var(--green);
}

.bar-row:nth-child(3) .bar-fill,
.legend-item:nth-child(3)::before {
  background: var(--red);
}

.bar-row span,
.rank-item span {
  color: var(--muted);
  font-size: 14px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 20px;
}

.donut {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0deg, var(--blue) 120deg, var(--green) 120deg, var(--green) 240deg, var(--red) 240deg);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background: var(--white);
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 16px;
}

.legend-item::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--blue);
  flex: 0 0 auto;
}

.legend-item strong {
  color: var(--ink);
  margin-left: auto;
}

.rank-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee7dc;
}

.rank-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rank-item strong {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.rank-main {
  display: grid;
  gap: 8px;
}

.language-rank {
  gap: 18px;
}

.lang-stack {
  width: min(520px, 100%);
  height: 12px;
  display: flex;
  overflow: hidden;
  background: #eee7dc;
}

.lang-segment {
  display: block;
  min-width: 0;
}

.rank-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: #f1eadf;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid #eee7dc;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

td {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill[data-status="Nuevo"] {
  background: #e7f1fb;
  color: #0f5d9c;
}

.status-pill[data-status="En curso"] {
  background: #fff1d6;
  color: #8a5a00;
}

.status-pill[data-status="Respondido"] {
  background: #e5f3ec;
  color: #1f6d4d;
}

.status-pill[data-status="Derivado"] {
  background: #f6e4e1;
  color: #9b3528;
}

.credit-footer {
  padding: 0 clamp(16px, 4vw, 56px) 48px;
  background: var(--paper);
}

.credit-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #8f8a82;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.credit-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #8f8a82;
}

.credit-brand strong {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.credit-icon {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

@media (max-width: 920px) {
  .hero-grid,
  .content-grid,
  .kpis,
  .filters {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding-top: 58px;
  }

  .filters {
    margin-top: -28px;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: 620px;
    padding-bottom: 96px;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 92px 1fr 34px;
  }

  .timeline {
    row-gap: 18px;
  }

  .trend-grid {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    row-gap: 18px;
  }

  .credit-inner {
    align-items: center;
    flex-direction: column;
    gap: 8px;
  }
}
