/* Session Analytics — feature styles v1 */

/* ── Layout ── */
.sa-header { margin-bottom: 1.5rem; }
.sa-header h1 { font-size: 1.25rem; font-weight: 700; color: var(--psa-text-primary); margin-bottom: .25rem; }
.sa-header p  { font-size: .8rem; color: var(--psa-text-secondary); }

/* ── Stats bar ── */
.sa-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.sa-stat {
    background: var(--psa-bg-card);
    border: 1px solid var(--psa-border);
    border-radius: 10px;
    padding: .875rem 1rem;
}
.sa-stat-label {
    font-size: .7rem;
    color: var(--psa-text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .3rem;
}
.sa-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--psa-text-primary);
    line-height: 1;
}
.sa-stat-sub { font-size: .7rem; color: var(--psa-text-dim); margin-top: .2rem; }

/* ── Tabs ── */
.sa-tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 1px solid var(--psa-border);
    margin-bottom: 1.5rem;
}
.sa-tab {
    padding: .5rem 1rem;
    font-size: .8rem;
    font-weight: 500;
    color: var(--psa-text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}
.sa-tab:hover { color: var(--psa-text-primary); }
.sa-tab.active {
    color: var(--psa-text-primary);
    border-bottom-color: #6366f1;
}

/* ── Tab content ── */
.sa-tab-content { display: none; }
.sa-tab-content.active { display: block; }

/* ── Chart cards ── */
.sa-chart-grid {
    display: grid;
    gap: 1rem;
}
.sa-chart-grid-2 { grid-template-columns: repeat(2, 1fr); }
.sa-chart-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
    .sa-chart-grid-2,
    .sa-chart-grid-3 { grid-template-columns: 1fr; }
}

.sa-card {
    background: var(--psa-bg-card);
    border: 1px solid var(--psa-border);
    border-radius: 10px;
    padding: 1rem;
}
.sa-card-title {
    font-size: .75rem;
    font-weight: 600;
    color: var(--psa-text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.sa-chart-area { width: 100%; }

/* ── Section separator ── */
.sa-section-gap { margin-top: 1.25rem; }

/* ── Anomaly tables ── */
.sa-anomaly-empty {
    text-align: center;
    padding: 2rem;
    color: var(--psa-text-dim);
    font-size: .8rem;
}
.sa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}
.sa-table th {
    text-align: left;
    padding: .5rem .75rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--psa-text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--psa-border);
}
.sa-table td {
    padding: .55rem .75rem;
    color: var(--psa-text-primary);
    border-bottom: 1px solid var(--psa-border);
}
.sa-table tr:last-child td { border-bottom: none; }
.sa-table tr:hover td { background: var(--psa-bg-hover); }

/* ── Alert badges ── */
.sa-badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 4px;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sa-badge-green    { background: #22c55e22; color: #22c55e; }
.sa-badge-yellow   { background: #eab30822; color: #eab308; }
.sa-badge-red      { background: #ef444422; color: #ef4444; }
.sa-badge-critical { background: #ef444422; color: #ef4444; }
.sa-badge-orange   { background: #f9731622; color: #f97316; }

/* ── Z-score bar ── */
.sa-zscore-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 600;
}
.sa-zscore-neg { color: #ef4444; }
.sa-zscore-pos { color: #22c55e; }

/* ── IRS spike card ── */
.sa-spike-card {
    background: var(--psa-bg-panel);
    border: 1px solid #ef444433;
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.sa-spike-name { font-size: .8rem; font-weight: 500; color: var(--psa-text-primary); }
.sa-spike-meta { font-size: .7rem; color: var(--psa-text-secondary); margin-top: .15rem; }
.sa-spike-irs  { font-size: 1.1rem; font-weight: 700; color: #ef4444; }

/* ── Loading state ── */
.sa-loading {
    text-align: center;
    padding: 3rem;
    color: var(--psa-text-dim);
    font-size: .8rem;
}
.sa-loading::after {
    content: '';
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--psa-border);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: sa-spin .7s linear infinite;
    margin-left: .5rem;
    vertical-align: middle;
}
@keyframes sa-spin { to { transform: rotate(360deg); } }

/* ── Tooltip (override psa-tip if needed) ── */
.psa-tip { cursor: help; }
