/* report.css — shared print stylesheet for the tools that produce a client
   report via the browser's print-to-PDF (DCMA 14-Point, Schedule Comparison).
   One source of truth so both reports carry the same Intelligent Planning house
   style as the website: white paper, a single blue accent, slate ink, a mono
   eyebrow, clean bordered tables. Screen appearance of the app is untouched —
   each tool still hides its own UI chrome inline (selectors differ per tool).
   Linked root-absolute so it resolves at any depth. */

/* The report container is hidden on screen; the running header/footer only make
   sense on paper. */
#report { display: none; }
.print-running-header, .print-running-footer { display: none; }

@media print {
  :root {
    --r-brand: #2563eb; --r-brand-dark: #1d4ed8; --r-brand-tint: #eff6ff;
    --r-text: #0f172a; --r-body: #1e293b; --r-muted: #475569; --r-faint: #64748b;
    --r-border: #e2e8f0; --r-border-2: #cbd5e1; --r-surface: #f8fafc; --r-head: #f1f5f9;
    --r-green: #166534; --r-amber: #b45309; --r-red: #dc2626;
  }

  #report { display: block; }

  @page { margin: 20mm 14mm 16mm; }

  .report-doc {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--r-body);
    font-size: 11px;
    line-height: 1.5;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  /* ---- Report title block --------------------------------------------------
     A mono eyebrow + a blue rule under the H1 gives the same brand signature as
     the site hero, injected purely from CSS so report.js needn't change. */
  .rpt-head, .titlepage { position: relative; padding-top: 4px; }
  .rpt-head::before, .titlepage::before {
    content: "INTELLIGENT PLANNING - FREE PRIMAVERA P6 TOOLS";
    display: block;
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
    font-size: 8.5px; font-weight: 700; letter-spacing: .12em;
    color: var(--r-brand); margin-bottom: 8px;
  }
  .report-doc h1 {
    font-size: 21px; line-height: 1.1; letter-spacing: -.02em;
    color: var(--r-text); margin: 0 0 4px; padding-bottom: 8px;
    border-bottom: 2px solid var(--r-brand);
  }
  .rpt-sub { font-size: 12.5px; color: var(--r-muted); margin: 6px 0 3px; }
  .rpt-meta, .rpt-note { color: var(--r-faint); font-size: 10px; margin: 3px 0; }

  .report-doc h2 {
    font-size: 14px; letter-spacing: -.01em; color: var(--r-text);
    margin: 18px 0 7px; padding-bottom: 4px;
    border-bottom: 1px solid var(--r-border);
  }
  .report-doc h2::before {
    content: ""; display: inline-block; width: 4px; height: 12px;
    background: var(--r-brand); border-radius: 2px;
    margin-right: 8px; vertical-align: -1px;
  }
  .report-doc h3 { font-size: 12px; color: var(--r-brand-dark); margin: 13px 0 4px; }
  .report-doc h4 { font-size: 11px; color: var(--r-text); margin: 8px 0 3px; }

  /* ---- Tables --------------------------------------------------------------- */
  table.rpt {
    border-collapse: collapse; width: 100%; font-size: 9.5px; margin: 8px 0;
    border: 1px solid var(--r-border-2);
  }
  table.rpt th, table.rpt td {
    border: 1px solid var(--r-border); padding: 4px 7px; text-align: left; vertical-align: top;
  }
  table.rpt th {
    background: var(--r-brand-tint); color: var(--r-brand-dark);
    font-weight: 700; letter-spacing: .01em; border-bottom: 1px solid var(--r-border-2);
  }
  table.rpt tbody tr:nth-child(even) { background: var(--r-surface); }
  .rpt td.num, .rpt td.band { text-align: center; font-weight: 700; }
  table.rpt.meta { max-width: 560px; }
  table.rpt.meta td:first-child { font-weight: 700; color: var(--r-muted); width: 34%; background: var(--r-surface); }

  /* RAG banding (DCMA) */
  tr.b-red td.band { color: var(--r-red); }
  tr.b-amber td.band { color: var(--r-amber); }
  tr.b-green td.band { color: var(--r-green); }
  tr.b-na td.band { color: var(--r-faint); }
  tr.b-red { background: #fef2f2 !important; }
  tr.b-amber { background: #fffbeb !important; }
  .dev { color: var(--r-amber); font-weight: 700; }

  /* ---- RAG summary pills ---------------------------------------------------- */
  .rpt-tally { margin: 10px 0; }
  .pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-weight: 700; font-size: 10px; padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--r-border-2); margin-right: 7px;
  }
  .pill.green { background: #f0fdf4; color: var(--r-green); border-color: #bbf7d0; }
  .pill.amber { background: #fffbeb; color: var(--r-amber); border-color: #fde68a; }
  .pill.red { background: #fef2f2; color: var(--r-red); border-color: #fecaca; }
  .pill.na { background: var(--r-head); color: var(--r-faint); }

  /* ---- Callouts ------------------------------------------------------------- */
  .cpt-note {
    border: 1px solid var(--r-border-2); border-left: 3px solid var(--r-brand);
    background: var(--r-surface); padding: 9px 12px; border-radius: 6px; margin: 12px 0;
    font-size: 10.5px;
  }
  .attribution { margin-top: 16px; font-size: 10.5px; color: var(--r-muted); font-weight: 600; }
  .disclaimer {
    margin-top: 8px; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e;
    padding: 9px 12px; border-radius: 6px; font-size: 10.5px; max-width: 560px;
  }
  .muted, p.muted { color: var(--r-faint); }
  .report-doc code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; background: var(--r-head); padding: 0 3px; border-radius: 3px; }

  /* ---- Layout helpers ------------------------------------------------------- */
  .titlepage { page-break-after: always; padding-top: 40px; }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .chart-embed { margin: 8px 0; }
  .chart-embed svg { max-width: 100%; height: auto; }
  .exec { margin: 6px 0 10px; padding-left: 18px; }
  .exec li { margin: 3px 0; }
  .narrative p { margin: 0 0 8px; }
  section, h2, h3 { break-inside: avoid; }
  .appx, section.appx { break-inside: avoid; page-break-inside: avoid; }

  /* ---- Optional client branding band + running header/footer (Sched Comp) --- */
  .brand-band { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
  .brand-band .brand-logo { max-height: 24mm; max-width: 74mm; object-fit: contain; }
  .brand-band .brand-header { font-size: 16px; font-weight: 800; color: var(--r-text); }

  .print-running-header {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: -14mm; left: 0; right: 0; height: 12mm;
    border-bottom: 1px solid var(--r-border-2); padding-bottom: 2mm;
  }
  .print-running-header .brand-logo { max-height: 10mm; max-width: 48mm; object-fit: contain; }
  .print-running-header .brand-header { font-weight: 700; font-size: 12px; color: var(--r-text); }
  .print-running-footer {
    display: flex; justify-content: space-between; font-size: 9px; color: var(--r-muted);
    position: fixed; bottom: -12mm; left: 0; right: 0;
    border-top: 1px solid var(--r-border); padding-top: 3px;
  }
  .print-running-footer .rf-review { color: var(--r-amber); font-weight: 700; }
}
