/*
 * Fire Stopping — Analytics surface (page-specific layout only).
 *
 * Chrome reuses the shared FS layer: page header (.fss-page-header), KPI strip
 * (.fss-stats-strip), tabs (.fss-tabs), data tables (.fss-table), chips
 * (.fss-chip) and the canonical filter rail/drawer (.ipi-filter-rail /
 * .tnt-filter-drawer) — all loaded via fire-stopping.css + inspections_shell.css.
 * This sheet owns ONLY the analytics-board layout primitives under the `.fsa-*`
 * namespace (metric cards, summary blocks, surfaces, board grid). Built on the
 * global :root tokens so dark mode comes for free.
 */

/* ---- Scope filter strip --------------------------------------------------- */
.fsa-scope-shell {
    margin: 0;
}

.fsa-scope-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ---- Workspace + board layout -------------------------------------------- */
.fsa-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.fsa-board {
    min-width: 0;
}

.fsa-board--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

/* Tab panels: defensive show/hide (mirrors the fire-door .analytics-tab-panel
   rule). analytics.js toggles both .is-active and [hidden] in sync. */
.fsa-tab-panel {
    display: none;
}

.fsa-tab-panel.is-active {
    display: block;
}

.fsa-panel-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* ---- Surfaces (cards) ----------------------------------------------------- */
.fsa-surface {
    min-width: 0;
    background: var(--surface-card);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
}

.fsa-surface--banner {
    padding: 14px 20px;
}

/* ---- Surface section header (wraps the shared ipi-result-meta) ------------ */
.fsa-surface-header {
    margin-bottom: 4px;
}

/* The section title is a semantic <h2> for document outline / a11y parity with
   the fire-door analytics surface header. Neutralise the UA heading margin and
   the global h1-h6 display-font so it keeps the compact ipi-result-label look. */
.fsa-surface-header__title {
    margin: 0;
    font-family: inherit;
}

.fsa-surface-header__copy {
    min-width: 0;
}

.fsa-surface-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ---- Metric cards --------------------------------------------------------- */
.fsa-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.fsa-metric-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 14px 16px;
    background: var(--surface-subtle);
    border-radius: 10px;
}

.fsa-metric-card__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.fsa-metric-card__value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ink);
}

.fsa-metric-card__value--warn {
    color: var(--danger);
}

.fsa-metric-card__meta {
    font-size: 11.5px;
    color: var(--ink-4);
}

/* ---- Summary blocks (label -> value rows) -------------------------------- */
.fsa-summary-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fsa-summary-block--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 28px;
}

.fsa-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    font-size: 13px;
    color: var(--ink-3);
    border-bottom: 1px solid var(--rule);
}

.fsa-summary-row:last-child {
    border-bottom: 0;
}

.fsa-summary-block--inline .fsa-summary-row {
    border-bottom: 0;
    padding: 0;
    gap: 10px;
}

.fsa-summary-row strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.fsa-summary-divider {
    height: 1px;
    margin: 10px 0;
    background: var(--rule);
}

/* ---- Tables section ------------------------------------------------------- */
.fsa-table-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* ---- Activity table cell -------------------------------------------------- */
.fsa-activity-cell {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.fsa-activity-cell__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fsa-activity-cell__title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.fsa-activity-cell__meta {
    font-size: 12px;
    color: var(--ink-4);
}

.fsa-activity-cell__meta a {
    color: var(--info, var(--accent));
    text-decoration: none;
}

.fsa-activity-cell__meta a:hover {
    text-decoration: underline;
}

/* ---- Helpers -------------------------------------------------------------- */
.fsa-warn {
    color: var(--danger);
}

.fsa-warn-amber {
    color: var(--accent-strong);
}

.fsa-link {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.fsa-link:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

.fsa-empty {
    padding: 28px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-4);
    background: var(--surface-card);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

/* ---- Responsive (≤900px) -------------------------------------------------- */
@media (max-width: 900px) {
    .fsa-board--split {
        grid-template-columns: minmax(0, 1fr);
    }

    .fsa-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fsa-summary-block--inline {
        gap: 8px 20px;
    }
}
