/* Shared timeframe (date-range) pill row.
   Matches the existing metric-toolbar / metric-btn look so the two controls
   read as one family rather than two different widgets. */

.tf-row {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px;
    flex-wrap: wrap;
}

.tf-btn {
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.tf-btn:hover { color: #0f172a; }

.tf-btn.active {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(99, 102, 241, 0.35);
}

.tf-btn:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 1px;
}

/* Wrapper the pages use to place the row above a chart. */
.tf-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.6rem 0;
    flex-wrap: wrap;
}

.tf-bar .tf-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-right: auto;
}

@media (max-width: 640px) {
    .tf-btn { font-size: 0.7rem; padding: 0.26rem 0.5rem; }
    .tf-bar { justify-content: flex-start; }
    .tf-bar .tf-label { width: 100%; margin-bottom: 0.15rem; }
}

/* When the pill row sits inside an existing metric-toolbar, keep it on the
   same baseline as the metric group and let it wrap first on narrow screens. */
.metric-toolbar .tf-inline { display: inline-flex; }
.metric-toolbar .tf-inline .tf-row { margin-right: 0.35rem; }
