/* Shared stylesheet for ARV & Investor Report pages.
   Per-report colours are supplied via CSS custom properties in each file's
   inline <style> block; defaults shown here are a neutral blue palette. */
:root {
  --hdr-from:        #0f3460;
  --hdr-to:          #16213e;
  --arv-bg-from:     #eef2ff;
  --arv-bg-to:       #f5f0ff;
  --primary:         #0f3460;
  --verdict-from:    #0f3460;
  --verdict-to:      #16213e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f7; color: #1a1a2e; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.header { background: linear-gradient(135deg, var(--hdr-from) 0%, var(--hdr-to) 100%); color: white; padding: 28px 20px 24px; }
.header-badge { background: rgba(255,255,255,0.18); border-radius: 20px; padding: 4px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; display: inline-block; }
.header h1 { font-size: 24px; font-weight: 800; margin-top: 10px; }
.header .sub { font-size: 14px; opacity: 0.75; margin-top: 3px; }
.header .date { font-size: 11px; opacity: 0.5; margin-top: 12px; }

/* ── ARV Banner ──────────────────────────────────────────────────────────── */
.arv-banner { background: white; margin: 14px 16px 0; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.07); }
.arv-main { padding: 22px 20px; text-align: center; background: linear-gradient(135deg, var(--arv-bg-from), var(--arv-bg-to)); }
.arv-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #6b7280; font-weight: 600; }
.arv-number { font-size: 48px; font-weight: 900; color: var(--primary); line-height: 1.1; margin: 6px 0 4px; }
.arv-confidence { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 10px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.arv-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid #f0f2f8; }
.arv-stat { padding: 14px 10px; text-align: center; border-right: 1px solid #f0f2f8; }
.arv-stat:last-child { border-right: none; }
.arv-stat-val { font-size: 17px; font-weight: 800; color: var(--primary); }
.arv-stat-lbl { font-size: 10px; color: #9ca3af; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Card sections ───────────────────────────────────────────────────────── */
.section { background: white; margin: 12px 16px 0; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.07); }
.section-header { padding: 13px 16px; border-bottom: 1px solid #f0f2f8; display: flex; align-items: center; gap: 8px; }
.section-icon { font-size: 16px; }
.section-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #6b7280; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.cell { padding: 14px 16px; border-bottom: 1px solid #f8f9ff; }
.cell:nth-child(odd) { border-right: 1px solid #f8f9ff; }
.cell-label { font-size: 11px; color: #9ca3af; font-weight: 500; margin-bottom: 3px; }
.cell-value { font-size: 17px; font-weight: 700; color: #1a1a2e; }
.cell-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.row { padding: 13px 16px; border-bottom: 1px solid #f8f9ff; display: flex; justify-content: space-between; align-items: center; }
.row:last-child { border-bottom: none; }
.row-label { font-size: 13px; color: #4b5563; }
.row-value { font-size: 14px; font-weight: 600; color: #1a1a2e; text-align: right; }

/* ── AI reasoning note ───────────────────────────────────────────────────── */
.ai-note, .ai-reasoning { padding: 14px 16px; font-size: 13px; color: #4b5563; line-height: 1.65; background: #f9fafb; border-top: 1px solid #f0f2f8; }
.ai-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; font-weight: 700; margin-bottom: 6px; }

/* ── Flip scenarios ──────────────────────────────────────────────────────── */
.scenario { padding: 16px; border-bottom: 1px solid #f8f9ff; }
.scenario:last-child { border-bottom: none; }
.scenario-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.scenario-name { font-size: 16px; font-weight: 700; }
.scenario-profit { font-size: 18px; font-weight: 800; color: #16a34a; text-align: right; }
.scenario-sub { font-size: 11px; color: #9ca3af; }
.scenario-line { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px dotted #f0f2f8; color: #6b7280; }
.scenario-line:last-child { border-bottom: none; font-weight: 700; color: #1a1a2e; font-size: 14px; }
.scenario-line span:last-child { font-weight: 600; color: #1a1a2e; }

/* ── Risk factors ────────────────────────────────────────────────────────── */
.risk-item { padding: 12px 16px; border-bottom: 1px solid #f8f9ff; display: flex; gap: 12px; align-items: flex-start; }
.risk-item:last-child { border-bottom: none; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.risk-high { background: #ef4444; } .risk-med { background: #f59e0b; } .risk-low { background: #22c55e; }
.risk-text { font-size: 13px; color: #4b5563; line-height: 1.5; }
.risk-text strong { color: #1a1a2e; display: block; margin-bottom: 2px; font-size: 14px; }

/* ── Verdict ─────────────────────────────────────────────────────────────── */
.verdict { background: linear-gradient(135deg, var(--verdict-from), var(--verdict-to)); color: white; margin: 12px 16px 0; border-radius: 14px; padding: 22px 18px; }
.verdict-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; opacity: 0.6; margin-bottom: 8px; }
.verdict-text { font-size: 14px; line-height: 1.65; opacity: 0.9; }
.verdict-targets { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 16px; }
.target { background: rgba(255,255,255,0.12); border-radius: 10px; padding: 12px 8px; text-align: center; }
.target-val { font-size: 18px; font-weight: 800; display: block; }
.target-lbl { font-size: 10px; opacity: 0.65; margin-top: 3px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Utility / footer ────────────────────────────────────────────────────── */
.tag-neutral { color: #d97706; } .tag-good { color: #16a34a; } .tag-bad { color: #dc2626; }
.disclaimer { text-align: center; font-size: 11px; color: #9ca3af; padding: 16px 20px 28px; line-height: 1.6; }
.powered { text-align: center; font-size: 10px; color: #d1d5db; padding-bottom: 8px; }

/* ── Print / Save-as-PDF button ──────────────────────────────────────────── */
.print-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary, #0f3460);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: opacity 0.2s, transform 0.2s;
}
.print-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.print-btn svg { flex-shrink: 0; }

/* ── Print / PDF media query ─────────────────────────────────────────────── */
@media print {
  /* Page margins */
  @page { margin: 0.6in 0.5in; }

  /* Preserve background colours so gradients render in PDF */
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  /* Hide screen-only chrome */
  .print-btn { display: none !important; }

  /* White canvas instead of grey */
  body { background: white !important; }

  /* Remove card shadows and outer margins */
  .section,
  .arv-banner,
  .verdict { box-shadow: none !important; margin-left: 0 !important; margin-right: 0 !important; border-radius: 10px !important; }

  /* Keep key blocks together across page breaks */
  .arv-banner,
  .section,
  .verdict,
  .scenario,
  .risk-item { break-inside: avoid; page-break-inside: avoid; }

  .header { break-after: avoid; page-break-after: avoid; }
}
