/* Usage chart (admin only) — js/usage-chart.js. The stacked chart at the top of
   /usage, /users and /bot-usage: filter buttons (All / People / Bots, links) on
   the left, the range on the right. The tiles and tables reuse the ba- classes
   in bot-access.css. */

.usage-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    flex-wrap: wrap;
}

.usage-seg {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.usage-seg-btn {
    padding: 5px 12px;
    border: 0;
    border-left: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}
.usage-seg-btn:first-child { border-left: 0; }
.usage-seg-btn:hover { background: var(--bg-input); color: var(--text); }
.usage-seg-btn.is-on { background: var(--accent); color: #fff; }

.usage-chart-sub {
    margin: 10px 0 8px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

.usage-chart-wrap {
    position: relative;
    height: 240px;
}
.usage-empty { padding-top: 90px; text-align: center; font-size: 13px; color: var(--text-dim); }

/* All view: three share tiles in one row at every width */
.ba-tiles.usage-tiles { grid-template-columns: repeat(3, 1fr); }
.usage-table-sub { margin: -8px 0 8px; }
.usage-scroll { overflow-x: auto; }
.usage-name { color: var(--text); overflow-wrap: anywhere; }

.usage-kind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.usage-kind::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
}
.usage-kind-people::before { background: #0d9488; }
.usage-kind-bots::before { background: #2563eb; }

@media (max-width: 480px) {
    .usage-chart-wrap { height: 220px; }
    .usage-seg-btn { padding: 5px 9px; font-size: 12px; }
    .ba-tiles.usage-tiles .ba-tile { padding: 10px 8px; }
    .ba-tiles.usage-tiles .ba-tile-value { font-size: 18px; }
}
