/* QQ admin portal, part 2 of 3: home, lists, detail pages, statistics and tables. */
/* Home */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  display: grid;
  gap: 2px;
  align-content: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
  min-height: 96px;
}
.stat.hot {
  background: var(--hot);
  border-color: var(--accent-text);
}
.stat .sub.block {
  display: block;
}
.addr {
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  min-width: 7.5em;
}
.num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
}
.stat .lbl {
  font-weight: 600;
  font-size: 0.88rem;
}
.stat .hint {
  margin: 0;
}
.health {
  font-weight: 600;
}
.health.ok {
  color: var(--ok);
}
.health.bad {
  color: var(--bad);
}
.gauges,
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.gauges li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 4px 10px;
  align-items: center;
}
.gauges li b {
  grid-column: 1 / -1;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -4px;
}
.gauges li > span:first-child {
  font-weight: 600;
  font-size: 0.9rem;
}
.rows li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.rows li:last-child {
  border-bottom: 0;
}
meter {
  width: 100%;
  height: 14px;
}

/* Lists */
.list {
  display: grid;
  gap: 8px;
}
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--ink);
  text-decoration: none;
}
.item .main {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.item .main b,
.item .sub {
  overflow-wrap: anywhere;
}
.sub {
  color: var(--muted);
  font-size: 0.85rem;
}
.sub.overdue {
  color: var(--bad);
  font-weight: 600;
}
.empty {
  color: var(--muted);
  padding: 12px 0;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.chip[aria-current] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.search {
  grid-template-columns: 1fr auto;
}
.tag {
  display: inline-block;
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag.ok {
  color: var(--ok);
  border-color: var(--ok);
}
.tag.warn {
  color: var(--warn);
  border-color: var(--warn);
}
.tag.bad {
  color: var(--bad);
  border-color: var(--bad);
}
.tag.stage-new,
.tag.stage-lead {
  color: var(--accent-text);
  border-color: var(--accent-text);
}

/* Detail */
.answers {
  margin: 0;
  display: grid;
  gap: 10px;
}
.answers dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: capitalize;
}
.answers dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.note p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Stats and tables */
.chart {
  width: 100%;
  height: 120px;
  fill: var(--accent);
}
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.log {
  margin: 8px 0 0;
  max-height: 420px;
  overflow: auto;
  background: #0c0c0e;
  color: #d6d6dc;
  border-radius: 12px;
  padding: 12px;
  font:
    0.78rem/1.45 ui-monospace,
    "Cascadia Mono",
    Menlo,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
