/* Сторінка «Зведення»: герой, лідери, картки команд. */

/* ---------------------------------------------------------------- герой */
.hero { padding: 0; overflow: hidden; }
.hero-main {
  display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  padding: 0;
}
/* Світла зелена плита у світлій темі, чорна з лаймовим числом — у темній. */
.hero-figure {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 22px 16px;
  background: var(--bar); background: light-dark(var(--hero-light), var(--bar));
  color: #fff; color: light-dark(var(--brand-ink), #fff);
}
.hero-figure .label { color: #A8A8A3; }
.hero-figure .label,
.hero-day .label {
  font-size: var(--micro-size); letter-spacing: var(--micro-track); text-transform: uppercase;
  font-weight: 600; color: var(--micro-color);
}
.hero-figure .label { color: light-dark(var(--green-ink), var(--micro-color)); }
.hero-time {
  font-family: var(--display); font-variant-numeric: tabular-nums;
  font-size: clamp(28px, 3.4vw, 44px); color: var(--brand); color: light-dark(var(--brand-ink), var(--brand));
  font-weight: 800; letter-spacing: -.04em; line-height: 1;
  margin: 2px 0 12px;
}

/* Три факти як показник приладу: підпис ліворуч, число праворуч, тонкі лінії */
.hero-facts { margin: 0; display: flex; flex-direction: column; }
.hero-facts > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-top: 1px solid #2A2A2A; border-color: light-dark(var(--green-border), #2A2A2A);
}
.hero-facts dt { font-size: 12px; color: #A8A8A3; color: light-dark(var(--green-ink), #A8A8A3); }
.hero-facts dd {
  margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 700;
}
.hero-facts dd.in { color: var(--brand); color: light-dark(var(--brand-ink), var(--brand)); }
.hero-facts dd.out { color: #8AA8FF; color: light-dark(var(--brand-ink), #8AA8FF); }
.hero-facts .hero-missed dd { color: #E6723C; color: light-dark(#873200, #E6723C); }
.hero-facts dd small { font-size: 11px; font-weight: 400; color: #87877F; color: light-dark(var(--green-ink), #87877F); }
.hero-day {
  display: flex; flex-direction: column; gap: 8px; justify-content: flex-end;
  padding: 20px 22px 16px;
}

.hero-leaders {
  border-top: 1px solid var(--line-soft); background: var(--panel);
  display: grid; grid-template-columns: 1fr 1fr;
}
.board { padding: 13px 22px 14px; }
.board + .board { border-left: 1px solid var(--line-soft); }
.board > .eyebrow {
  display: block; margin-bottom: 8px;
  font-size: var(--micro-size); letter-spacing: var(--micro-track); text-transform: uppercase;
  font-weight: 600; color: var(--micro-color);
}

/* Перше місце — з денною смугою; друге й третє свідомо тихіші,
   щоб борд лишався про лідера, але з видимим відривом. */
.lead {
  display: flex; align-items: flex-start; gap: 11px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.rank-badge {
  flex: none; width: 22px; height: 22px; border-radius: var(--pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--brand-ink);
  font-family: var(--mono); font-size: 12px; font-weight: 700; line-height: 1;
  margin-top: 1px;
}
.lead-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.lead-who b {
  font-family: var(--display), var(--ui);
  font-size: 15px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3;
}
.lead-who .lead-sub { font-size: 11px; color: var(--muted); }
.lead .day { margin-top: 4px; width: 96px; }
.lead-time {
  font-family: var(--display); font-variant-numeric: tabular-nums;
  font-size: 17px; font-weight: 800; letter-spacing: -.02em; flex: none; text-align: right;
}

.lead-minor {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 0 0;
}
.lead-minor .rank {
  flex: none; width: 21px; text-align: center;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
}
.lead-minor .lead-who b { font-family: var(--ui); font-size: 12.5px; font-weight: 600; }
.lead-minor .lead-sub { font-size: 10.5px; }
.lead-minor .lead-time { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lead-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* ---------------------------------------------------------------- картки команд */
.managers-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 2px 12px; border-top: 1px solid var(--line); margin-top: 20px;
}
.managers-bar h2 {
  margin: 0; font-size: var(--micro-size); letter-spacing: var(--micro-track); text-transform: uppercase;
  font-weight: 700; color: var(--text);
}
.managers-bar .note { margin-left: auto; }

/* Без overflow:hidden — інакше картка стає контейнером прокрутки
   і sticky всередині неї рахується від картки, а не від вікна. */
.team-card {
  background: var(--panel); border: 1px solid transparent;
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 10px; scroll-margin-top: 64px;
}
.team-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 20px; height: auto; cursor: pointer; text-align: left;
  background: var(--raised); color: var(--text);
  border: 0; font-size: 14px; font-weight: 650;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  position: sticky; top: var(--header-h); z-index: 5;
}
.team-head:hover { background: var(--accent-soft); filter: none; }
.team-card.collapsed .team-head { border-radius: calc(var(--radius) - 1px); }
.team-card.collapsed .team-body { display: none; }
.team-head .caret {
  color: var(--faint); width: 15px; flex: none;
  display: inline-flex; transition: transform .18s ease;
}
.team-card.collapsed .caret { transform: rotate(-90deg); }
.team-head .team-name { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; white-space: normal; }
.team-head .team-rank {
  font-family: var(--mono); font-size: 12px; color: var(--faint);
  width: 20px; text-align: right; flex: none; font-weight: 500;
}
.team-head .team-size, .team-head .team-avg {
  font-family: var(--mono); font-size: 11.5px; color: var(--faint); font-weight: 400;
}

/* Права частина заголовка — компактний вимірювач команди */
.team-head .team-meta {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  font-weight: 500; font-size: 12px; color: var(--muted); flex: none;
}
.team-head .level-time { font-size: 14px; font-weight: 700; color: var(--text); }
.team-head .level-track { width: 90px; }

.team-card thead th { background: var(--panel); }
.team-card tbody tr:last-child td:first-child { border-bottom-left-radius: calc(var(--radius) - 1px); }
.team-card tbody tr:last-child td:last-child { border-bottom-right-radius: calc(var(--radius) - 1px); }
.team-card .table-wrap.flow th { top: calc(var(--header-h) + 49px); }

/* Крапка активності біля імені */
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 9px; vertical-align: 1px; flex: none;
}
.dot.ok { background: var(--in); }
.dot.warn { background: var(--sig-hot); }
.dot.old { background: var(--dead); opacity: .7; }
td.ago { color: var(--muted); font-size: 12.5px; }

/* Ім'я на дашборді веде на сторінку аналітики людини. Колір тексту, а не
   посилання: таблиця має читатися як таблиця, а не як список лінків. */
.person-link { color: inherit; }
.person-link:hover { color: var(--accent); }
