/**
 * Shared styles for security audit tools (A3 headers, A4 jwt audit,
 * A5 apache/nginx config linter, A6 composer audit, B3.1 jwt decoder).
 *
 * Generic patterns (textarea/tabs/panel/result/findings/score/actions)
 * live in the design system (public.css). This file only carries
 * cluster-specific layouts: dual-pane JWT decoded view, composer stats
 * grid, vertical section wrapper, summary score+counts grid.
 *
 * Print-friendly: window.print() generates a clean report (generic print
 * rules in public.css section 32).
 */

/* Section wrapper - vertical stack with consistent gap. */
.sa-section { display: flex; flex-direction: column; gap: 0.8rem; }

/* ===== Summary grid (score on the left, severity counts on the right) ===== */

.sa-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--c-line, #e2e8f0);
    margin-bottom: 1.2rem;
}

@media (min-width: 600px) {
    .sa-summary { grid-template-columns: auto 1fr; }
}

/* ===== JWT decoded dual-pane (header/payload + claims explainer) ===== */

.sa-jwt-decoded {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
}

@media (min-width: 720px) {
    .sa-jwt-decoded { grid-template-columns: 1fr 1fr; }
}

.sa-jwt-block {
    border: 1px solid var(--c-line, #e2e8f0);
    border-radius: var(--r-md, 10px);
    overflow: hidden;
}

.sa-jwt-block-header {
    background: var(--c-bg, #f8fafc);
    padding: 0.5rem 0.8rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--c-ink, #0f172a);
    border-bottom: 1px solid var(--c-line, #e2e8f0);
}

.sa-jwt-block-body {
    padding: 0.7rem 0.8rem;
    background: #0f172a;
    color: #e2e8f0;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* ===== Composer audit stats grid (auto-fit fluid) ===== */

.sa-composer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.sa-composer-stat {
    padding: 0.7rem 0.9rem;
    background: var(--c-bg, #f8fafc);
    border: 1px solid var(--c-line, #e2e8f0);
    border-radius: var(--r-md, 10px);
}

.sa-composer-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-blue, #0065c0);
    font-family: var(--font-mono, ui-monospace, monospace);
    line-height: 1;
}

.sa-composer-stat-label {
    font-size: 0.78rem;
    color: var(--c-ink-mute, #64748b);
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* JWT decoder expiry / verify */
.jd-exp { font-weight: 700; }
.jd-exp-ok { color: #15803d; }
.jd-exp-bad { color: #b91c1c; }
.jd-verify-status {
    margin-top: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.jd-verify-status.is-ok      { color: #15803d; }
.jd-verify-status.is-bad     { color: #b91c1c; }
.jd-verify-status.is-warn    { color: #ca8a04; }
.jd-verify-status.is-pending { color: var(--c-blue, #0065c0); }

/* Apache/Nginx linter dialect tag */
.an-dialect-tag {
    text-transform: uppercase;
    color: var(--c-blue, #0065c0);
}

/* ===== Print stylesheet (cluster-specific overrides) =====
 * Generic print rules in public.css section 32. */
@media print {
    .sa-actions { display: none !important; }
    .sa-jwt-block { page-break-inside: avoid; border: 1px solid #000 !important; background: #fff !important; }
    .sa-jwt-block-body { background: #fff !important; color: #000 !important; }
}
