/*! © 2026 Cyber Affinity LLC. All rights reserved. Use is subject to https://www.cyber-affinity.com/terms — copying or redistributing this code is not permitted. */
/* Weekly Status Report Generator — builds on /styles.css tokens */
.sr-wrap { max-width: 1320px; }
.sr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; margin-top: 16px; }
.sr-left { display: grid; gap: 16px; min-width: 0; }

/* Affinity PM Lite pull */
.sr-lite { display: grid; gap: 10px; border-color: rgba(45, 212, 191, 0.45); }
.page .sr-lite h2 { font-size: 18px; margin: 0; color: var(--accent); }
.sr-lite .btn { justify-self: start; }
.page .sr-lite-msg { margin: 0; font-size: 14px; color: var(--text); min-height: 1.2em; }
.sr-lite-msg:empty { display: none; }

/* Inputs */
.sr-form { gap: 16px; }
.sr-sec { display: grid; gap: 14px; }
.page .sr-sec h2 { font-size: 18px; margin: 0; color: var(--accent-2); }
.sr-sec > .small { margin-top: -8px; }
.sr-sec > .btn { justify-self: start; }
.sr-rows { display: grid; gap: 10px; }
.sr-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.sr-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sr-item-head b { font-size: 14px; color: var(--muted); }
.sr-item-head .rr-x { padding: 0 8px; }
.sr-sec label { font-size: 13px; }
.sr-rows input, .sr-rows select { padding: 8px 10px; font-size: 14px; }
.sr-li, .sr-metric { display: flex; gap: 8px; align-items: end; }
.sr-metric > label:nth-child(2) { flex: 0 1 200px; }
.sr-area { display: grid; grid-template-columns: minmax(120px, 0.6fr) minmax(0, 1.4fr); gap: 10px; align-items: end; }
.sr-ms { display: grid; grid-template-columns: minmax(0, 1fr) 150px 96px auto; gap: 8px; align-items: end; }
.sr-grow { flex: 1 1 auto; min-width: 0; }
.page .sr-field-err { margin: -6px 0 0; font-size: 13px; font-weight: 600; color: #fca5a5; min-height: 0; }
.sr-field-err:empty { display: none; }
input[aria-invalid="true"] { border-color: #f87171; }

/* Output panel */
.sr-out { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; display: grid; gap: 12px; }
.sr-out-head .panel-title { margin-top: 0; }
.sr-out-head .out-actions { margin-top: 8px; }
.page .sr-warn { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: #fde047; }
.sr-warn:empty { display: none; }

/* The report itself: a white "paper" so the preview matches the printout */
.sr-paper { background: #fff; color: #1a2433; border-radius: 10px; padding: 28px 30px; font-size: 14px; line-height: 1.5; display: grid; gap: 16px; min-width: 0; overflow-wrap: anywhere; }
.page .sr-paper p, .page .sr-paper li { color: #1a2433; }
.sr-paper p { margin: 0; }
.page .sr-empty { color: #52627a; text-align: center; padding: 40px 12px; }
.sr-head { border-bottom: 2px solid #1a2433; padding-bottom: 10px; }
.page .sr-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #0f766e; }
.page .sr-head h2 { font-size: 26px; margin: 2px 0; color: #0b1422; letter-spacing: -0.01em; }
.page .sr-meta { font-size: 13px; color: #52627a; }
.sr-block { display: grid; gap: 8px; break-inside: avoid; }
.sr-block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: #0b1422; margin: 0; border-bottom: 1px solid #d5dde8; padding-bottom: 4px; }
.sr-overall-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sr-badge { display: inline-block; font-weight: 800; font-size: 15px; border-radius: 8px; padding: 5px 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sr-badge.green { background: #16a34a; color: #fff; }
.sr-badge.amber { background: #fde047; color: #422006; }
.sr-badge.red { background: #dc2626; color: #fff; }
.sr-badge.none { background: #eef2f7; color: #475569; }
.sr-trend { font-weight: 700; font-size: 15px; color: #1a2433; }
.page .sr-reason { font-size: 15px; }
.sr-sub { color: #52627a; }
.sr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sr-table th { background: #eef2f7; color: #334155; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid #cbd5e1; text-align: left; white-space: nowrap; }
.sr-table td { padding: 6px 8px; border-bottom: 1px solid #e2e8f0; color: #1a2433; vertical-align: top; }
.sr-table tr { break-inside: avoid; }
.sr-nowrap { white-space: nowrap; }
.sr-paper .flag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sr-paper .flag.green { background: #dcfce7; color: #166534; }
.sr-paper .flag.yellow { background: rgba(253, 224, 71, 0.45); color: #713f12; }
.sr-paper .flag.red { background: #fee2e2; color: #991b1b; }
.sr-paper ul, .sr-paper ol { margin: 0; padding-left: 20px; }
.sr-paper li { margin: 3px 0; }
.sr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* History */
.sr-history { margin-top: 24px; display: grid; gap: 10px; }
.page .sr-history h2 { font-size: 18px; margin: 0; color: var(--accent-2); }
.sr-history .out-actions { margin-top: 0; }
.sr-hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sr-hist { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.page .sr-hist { color: var(--text); }
.sr-hist-text { min-width: 0; overflow-wrap: anywhere; }
.sr-hist-text strong { color: var(--text); }
.sr-hist-when { display: block; }
.sr-hist-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

@media (max-width: 1060px) {
  .sr-layout { grid-template-columns: 1fr; }
  .sr-out { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 560px) {
  .sr-area { grid-template-columns: 1fr; }
  .sr-ms { grid-template-columns: 1fr 1fr auto; }
  .sr-ms > label:first-child { grid-column: 1 / -1; }
  .sr-metric { flex-wrap: wrap; }
  .sr-metric > label:first-child { flex-basis: 100%; }
  .sr-two { grid-template-columns: 1fr; }
  .sr-paper { padding: 20px 16px; }
}

@media print {
  .sr-page { padding: 0; }
  .sr-wrap { max-width: none; padding: 0; }
  .sr-layout { display: block; margin: 0; }
  .sr-out { position: static; max-height: none; overflow: visible; background: #fff !important; border: 0 !important; padding: 0; display: block; break-inside: auto !important; }
  .sr-paper { padding: 0; border-radius: 0; font-size: 12.5px; gap: 12px; }
  .page .sr-head h2 { font-size: 22px; }
  .sr-paper .flag { border: 0 !important; }
  .sr-paper .flag.green { background: #dcfce7 !important; color: #166534 !important; }
  .sr-paper .flag.yellow { background: rgba(253, 224, 71, 0.45) !important; color: #713f12 !important; }
  .sr-paper .flag.red { background: #fee2e2 !important; color: #991b1b !important; }
  .sr-table th { background: #eef2f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sr-two { grid-template-columns: 1fr 1fr; }
}
