:root {
  color-scheme: light;
  --bg: #f5f6f4;
  --panel: #ffffff;
  --line: #dedfda;
  --text: #20231f;
  --muted: #666c61;
  --blue: #0b74b8;
  --green: #16805d;
  --red: #b33b36;
  --yellow: #d6a21d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  position: sticky;
  top: 0;
  z-index: 3;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.brand img { width: 38px; height: 38px; }
.brand strong { display: block; font-size: 15px; }
.brand span { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 4px; align-self: stretch; }
.nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 0 14px;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.nav button.active { color: var(--text); border-bottom-color: var(--text); }
.session { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.app { max-width: 1180px; margin: 0 auto; padding: 28px 22px 46px; }
.hidden { display: none !important; }
.login {
  max-width: 460px;
  margin: 34px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: 24px; }
h2 { font-size: 20px; margin-bottom: 16px; }
h3 { font-size: 14px; }
.subtle { color: var(--muted); line-height: 1.45; }
.field { display: grid; gap: 6px; margin-top: 16px; }
.field label { font-weight: 650; font-size: 12px; color: #3f463d; }
input, select {
  width: 100%;
  height: 38px;
  border: 1px solid #cfd2cb;
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
  background: white;
}
button {
  border: 1px solid #c9cdc5;
  border-radius: 6px;
  background: white;
  color: var(--text);
  height: 34px;
  padding: 0 12px;
  font: inherit;
  cursor: pointer;
}
button.primary { background: var(--blue); color: white; border-color: var(--blue); font-weight: 650; }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 8px; margin-top: 18px; }
.status { margin-top: 14px; min-height: 20px; color: var(--muted); }
.status.error { color: var(--red); }
.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
.filters { display: flex; gap: 8px; align-items: center; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.metric strong { font-size: 22px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  color: #7a7f76;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #fafafa;
}
th, td { padding: 10px 12px; border-bottom: 1px solid #eceee9; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.cat-row td { font-weight: 750; background: #fbfcfa; }
.sub-name { padding-left: 28px; }
.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef4f0;
  color: #496154;
  font-size: 11px;
  margin-left: 6px;
}
.bars { display: grid; gap: 8px; padding: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(170px, 260px) 1fr 92px; gap: 12px; align-items: center; }
.bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: #eceee9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; }
.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 64px; align-items: flex-start; flex-wrap: wrap; padding: 12px; gap: 10px; }
  .brand { min-width: 100%; }
  .nav { order: 3; width: 100%; height: 42px; }
  .nav button { flex: 1; padding: 0 8px; }
  .session { margin-left: 0; }
  .app { padding: 18px 12px 32px; }
  .head { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr; }
  .panel { overflow-x: auto; }
  table { min-width: 720px; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
}
