:root {
  --bg: #0d1117; --surface: #161b22; --border: #30363d; --text: #e6edf3; --muted: #8d96a0;
  --accent: #3fb950; --link: #58a6ff;
  --s0: #21262d; --s1: #0e4429; --s2: #006d32; --s3: #26a641; --s4: #39d353;
  --active: #3fb950; --paused: #d29922; --archived: #8d96a0; --del: #f85149;
}
:root[data-theme="light"] {
  --bg: #ffffff; --surface: #f6f8fa; --border: #d0d7de; --text: #1f2328; --muted: #656d76;
  --accent: #2da44e; --link: #0969da;
  --s0: #ebedf0; --s1: #9be9a8; --s2: #40c463; --s3: #30a14e; --s4: #216e39;
  --active: #1a7f37; --paused: #9a6700; --archived: #656d76; --del: #cf222e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-weight: 400; }

.top { border-bottom: 1px solid var(--border); background: var(--surface); }
.top-inner { display: flex; align-items: flex-start; gap: 16px; padding-top: 24px; padding-bottom: 20px; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.tagline { margin: 4px 0 10px; color: var(--muted); }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.site { font-weight: 600; }

.who { flex: 1; min-width: 0; }
.avatar {
  width: 72px; height: 72px; flex: none; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
.icon-btn {
  align-self: flex-start; width: 38px; height: 38px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 18px;
}
.icon-btn:hover { border-color: var(--muted); }

main.wrap { padding-top: 32px; padding-bottom: 24px; }
section { margin-top: 32px; min-width: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.kpi b { display: block; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi span { color: var(--muted); font-size: 13px; }

.records { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.records .kpi b { font-size: 24px; }
.note { margin: 6px 0 0; font-size: 12px; }
.chart { width: 100%; height: 300px; }
.chart.h-heat { height: 190px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.filters label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; font: inherit;
}

.table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--surface); font-size: 13px; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.name { font-weight: 600; }
.desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge {
  display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  border: 1px solid currentColor;
}
.badge.activo { color: var(--active); }
.badge.pausado { color: var(--paused); }
.badge.archivado { color: var(--archived); }

.error { background: #ffebe9; color: #82071e; border: 1px solid #ff8182; padding: 10px 14px; border-radius: 8px; }
footer { padding-top: 16px; padding-bottom: 32px; font-size: 13px; }

@media (max-width: 860px) {
  .kpis, .records { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .kpi b { font-size: 24px; }
  .avatar { width: 56px; height: 56px; }
  .table-wrap { border: 0; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
  td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; }
  td.proj { display: block; text-align: left; }
  td.proj::before { content: none; }
}
