/*
 * Security report styles, shared by the printed report (linked from the
 * report window) and the executive summary drawn in wp-admin.
 * Built by assets/cs-report.js; see the header there.
 *
 * Every coloured box states its own text colour. Severity colours are set
 * inline by cs-report.js from one table, so they are not repeated here.
 */

.csr { color: #0f172a; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.55; }
.csr *, .csr *::before, .csr *::after { box-sizing: border-box; }

/* Browsers drop background colours when printing unless asked. Without this
   every coloured heading in the old reports printed as grey text. */
.csr, .csr * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

body.csr-doc { margin: 0; background: #e2e8f0; }
body.csr-doc > .csr { max-width: 880px; margin: 0 auto; background: #fff; padding: 0 0 28px; font-size: 14px; }

.csr-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 32px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #475569; }
.csr-toolbar button { background: #4338ca; color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }

.csr-cover { background: #0f172a; color: #f8fafc; padding: 30px 32px 24px; }
.csr-kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #a5b4fc; }
.csr-cover h1 { margin: 6px 0 12px; font-size: 28px; line-height: 1.2; font-weight: 800; color: #fff; }
.csr-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.csr-meta span { font-size: 12px; color: #e2e8f0; background: #1e293b; border: 1px solid #334155; border-radius: 999px; padding: 3px 10px; }

.csr-sec { padding: 0 32px; margin-top: 26px; }
.csr-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; color: #fff; font-size: 16px; font-weight: 800; break-after: avoid; page-break-after: avoid; }
.csr-h-right { font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 2px 10px; color: #fff; }
.csr-sec-why { margin: -4px 0 12px; font-size: 13px; color: #475569; }

/* Executive summary */
.csr-summary > * + * { margin-top: 12px; }
.csr-verdict { display: flex; gap: 14px; align-items: center; border: 2px solid; border-radius: 10px; padding: 14px 16px; }
.csr-verdict-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; }
.csr-verdict-head { font-size: 20px; font-weight: 800; line-height: 1.2; }
.csr-verdict-sub { font-size: 14px; color: #1e293b; margin-top: 2px; }

.csr-overview { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.csr-score { flex: 0 0 230px; text-align: center; }
.csr-gauge { display: block; margin: 0 auto 6px; }
.csr-score-note { font-size: 11px; margin: 6px 0 0; }
.csr-scale-bar { position: relative; display: flex; height: 10px; border-radius: 5px; overflow: visible; }
.csr-scale-bar span { display: block; height: 10px; }
.csr-scale-bar span:first-child { border-radius: 5px 0 0 5px; }
.csr-scale-bar span:last-child { border-radius: 0 5px 5px 0; }
.csr-scale-mark { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; background: #0f172a; border: 1px solid #fff; border-radius: 2px; }
.csr-scale-labels { display: flex; font-size: 9px; color: #475569; margin-top: 4px; line-height: 1.25; }
.csr-scale-labels span { display: block; text-align: center; }
.csr-sums { flex: 1 1 320px; display: grid; gap: 10px; }
.csr-sum { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px; }
.csr-sum p { margin: 0; font-size: 13.5px; color: #1e293b; }
.csr-sum-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4338ca; margin-bottom: 3px; }

.csr-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.csr-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; break-inside: avoid; page-break-inside: avoid; }
.csr-card-h { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #334155; }
.csr-bars { display: block; width: 100%; max-width: 520px; height: auto; }
.csr-muted { color: #64748b; font-size: 12px; margin: 6px 0 0; }

.csr-prio { list-style: none; margin: 0; padding: 0; }
.csr-prio li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid #f1f5f9; font-size: 13px; }
.csr-prio li:first-child { border-top: 0; }
.csr-prio-id, .csr-id { flex: none; color: #fff; font-weight: 800; font-size: 11px; border-radius: 5px; padding: 2px 6px; min-width: 28px; text-align: center; }
.csr-prio-title { flex: 1; color: #0f172a; font-weight: 600; }
.csr-prio-when { flex: none; font-size: 11px; font-weight: 700; border: 1px solid; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

.csr-legend-inline { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: #334155; margin-top: 6px; }
.csr-legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

.csr-notice { border: 1px solid; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; }

/* Key */
.csr-key { width: 100%; border-collapse: collapse; font-size: 13px; }
.csr-key th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #475569; border-bottom: 2px solid #e2e8f0; padding: 6px 8px; }
.csr-key td { border-bottom: 1px solid #f1f5f9; padding: 8px; vertical-align: top; color: #1e293b; }
.csr-num { text-align: center; font-weight: 800; }
.csr-pill { display: inline-block; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* Findings */
.csr-finding { border: 1px solid; border-left-width: 6px; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; break-inside: avoid; page-break-inside: avoid; }
.csr-finding-top { display: flex; gap: 10px; align-items: flex-start; }
.csr-finding h4 { margin: 0; font-size: 15px; line-height: 1.35; color: #0f172a; }
.csr-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.csr-when { font-size: 12px; font-weight: 800; }
.csr-tag { font-size: 11px; color: #334155; background: #fff; border: 1px solid #cbd5e1; border-radius: 999px; padding: 1px 8px; }
.csr-label { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #475569; margin: 8px 0 2px; }
.csr-block p, .csr-fix p { margin: 0; font-size: 13.5px; color: #1e293b; }
.csr-fix { background: #fff; border: 1px solid #c7d2fe; border-radius: 6px; padding: 2px 12px 10px; margin-top: 8px; }
.csr-fix .csr-label { color: #3730a3; }
.csr code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: #eef2ff; color: #312e81; border: 1px solid #e0e7ff; border-radius: 4px; padding: 0 4px; word-break: break-word; }
.csr a { color: #1d4ed8; }

/* Already good */
.csr-good-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.csr-good { display: flex; gap: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px 12px; break-inside: avoid; page-break-inside: avoid; }
.csr-good strong { color: #14532d; font-size: 13.5px; }
.csr-good p { margin: 3px 0 0; font-size: 12.5px; color: #1e293b; }
.csr-good-tick { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #15803d; color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; }

.csr-foot { margin: 28px 32px 0; padding-top: 12px; border-top: 1px solid #e2e8f0; font-size: 11px; color: #64748b; }

/* In wp-admin the summary sits inside a panel, not on a page. */
.csr-summary { margin: 0 0 16px; }

@media (max-width: 640px) {
    .csr-sec, .csr-cover, .csr-toolbar { padding-left: 16px; padding-right: 16px; }
    .csr-score { flex-basis: 100%; }
    .csr-prio li { flex-wrap: wrap; }
}

@media print {
    @page { margin: 14mm 12mm; }
    body.csr-doc { background: #fff; }
    body.csr-doc > .csr { max-width: none; padding: 0; }
    .csr-toolbar { display: none; }
    .csr-sec { padding: 0; }
    .csr-cover { border-radius: 10px; }
    .csr-foot { margin-left: 0; margin-right: 0; }
}
