/* ============================================================
   Redwood Privacy — Monthly Report Page Styles
   ============================================================ */

/* ── Page shell (reuses dashboard sidebar) ───────────────────── */
.report-body {
  background-color: var(--bg-void);
  background-image: var(--bg-glossy-canvas);
  background-attachment: fixed;
  min-height: 100dvh;
}

.report-layout { display: block; min-height: 100dvh; }

.report-content {
  margin-left: 240px;
  padding: var(--space-8) var(--space-8) var(--space-16);
  min-height: 100vh;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ── Page header ─────────────────────────────────────────────── */
.report-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.report-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-600);
  margin-bottom: var(--space-2);
}

.report-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.report-period {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.report-actions { display: flex; gap: var(--space-3); align-items: center; flex-shrink: 0; }

/* ── Score banner ────────────────────────────────────────────── */
.report-score-banner {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-8) var(--space-10);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}

.report-score-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 10% 0%, rgba(255,255,255,0.1) 0%, transparent 55%);
  pointer-events: none;
}

/* Score ring */
.report-gauge { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.report-gauge svg { transform: rotate(-90deg); }
.report-gauge-track { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 9; }
.report-gauge-fill  {
  fill: none; stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1);
}
.report-gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.report-gauge-value { font-size: 1.8rem; font-weight: 900; color: #fff; line-height: 1; letter-spacing: -0.04em; }
.report-gauge-denom { font-size: 10px; color: rgba(255,255,255,0.55); font-weight: 500; margin-top: 2px; }

/* Banner text */
.report-banner-text {}
.report-banner-grade {
  display: inline-block;
  font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-2);
}
.report-banner-headline {
  font-size: var(--text-2xl); font-weight: 800; color: #fff;
  line-height: 1.2; margin-bottom: var(--space-3);
}
.report-banner-sub {
  font-size: var(--text-sm); color: rgba(255,255,255,0.7); line-height: 1.65;
  max-width: 420px;
}

/* Banner stats */
.report-banner-stats {
  display: flex; flex-direction: column; gap: var(--space-3);
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: var(--space-8);
  flex-shrink: 0;
}
.report-banner-stat { text-align: center; }
.report-banner-stat-value {
  font-size: var(--text-2xl); font-weight: 900; color: #fff;
  line-height: 1; letter-spacing: -0.03em;
}
.report-banner-stat-label {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 3px;
}

/* ── Grid sections ───────────────────────────────────────────── */
.report-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.report-full { margin-bottom: var(--space-5); }

/* ── Section panels ──────────────────────────────────────────── */
.report-panel {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.report-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.report-panel-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.report-panel-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
}

.report-panel-body { padding: var(--space-5); }

/* ── Company rows ────────────────────────────────────────────── */
.company-report-list { display: flex; flex-direction: column; gap: var(--space-3); }

.company-report-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  transition: box-shadow var(--transition-fast);
}

.company-report-row:hover { box-shadow: var(--shadow-sm); }

.company-report-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.company-report-info { flex: 1; min-width: 0; }
.company-report-name {
  font-size: var(--text-sm); font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.company-report-cat {
  font-size: var(--text-xs); color: var(--text-muted);
}

/* Score bar */
.company-report-bar-wrap { width: 100px; flex-shrink: 0; }
.company-report-bar-bg {
  height: 6px; background: var(--border-subtle); border-radius: var(--radius-full);
  overflow: hidden;
}
.company-report-bar {
  height: 100%; border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.company-report-score {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  margin-top: 3px; text-align: right;
}

.company-report-grade {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 900;
  flex-shrink: 0;
}

/* ── Risk list ───────────────────────────────────────────────── */
.risk-list { display: flex; flex-direction: column; gap: var(--space-3); }

.risk-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.risk-item-critical { background: rgba(239,68,68,0.04);  border-color: rgba(239,68,68,0.2); }
.risk-item-high     { background: rgba(249,115,22,0.04); border-color: rgba(249,115,22,0.2); }
.risk-item-medium   { background: rgba(245,158,11,0.04); border-color: rgba(245,158,11,0.2); }
.risk-item-low      { background: rgba(34,197,94,0.04);  border-color: rgba(34,197,94,0.15); }

.risk-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}

.risk-body { flex: 1; min-width: 0; }
.risk-title { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.risk-desc  { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.55; }

.risk-level {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
  flex-shrink: 0; align-self: flex-start; margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.risk-level-critical { background: rgba(239,68,68,0.1);  color: #dc2626; }
.risk-level-high     { background: rgba(249,115,22,0.1); color: #ea580c; }
.risk-level-medium   { background: rgba(245,158,11,0.1); color: #d97706; }
.risk-level-low      { background: rgba(34,197,94,0.1);  color: #16a34a; }

/* ── Recommendations ─────────────────────────────────────────── */
.rec-list { display: flex; flex-direction: column; gap: var(--space-3); }

.rec-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.rec-num {
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  background: var(--blue-600);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0; margin-top: 1px;
}

.rec-body { flex: 1; }
.rec-title { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.rec-desc  { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.55; }
.rec-action {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: var(--text-xs); font-weight: 600;
  color: var(--blue-600); text-decoration: none;
}
.rec-action:hover { color: var(--blue-700); }

/* ── Data exposure table ─────────────────────────────────────── */
.exposure-table { width: 100%; border-collapse: collapse; }

.exposure-table th {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.exposure-table td {
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-elevated);
  vertical-align: middle;
}

.exposure-table tr:last-child td { border-bottom: none; }
.exposure-table tr:hover td { background: var(--bg-elevated); }

.exposure-type { font-weight: 600; color: var(--text-primary); }

.exposure-companies {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.exposure-company-chip {
  font-size: 10px; font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
}

.exposure-risk-bar {
  display: flex; align-items: center; gap: var(--space-2);
}
.exposure-risk-bg {
  flex: 1; height: 5px;
  background: var(--border-subtle); border-radius: var(--radius-full);
  overflow: hidden; max-width: 80px;
}
.exposure-risk-fill { height: 100%; border-radius: var(--radius-full); }

/* ── Empty state ─────────────────────────────────────────────── */
.report-empty {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--text-muted);
}
.report-empty-icon { font-size: 2.5rem; margin-bottom: var(--space-4); }
.report-empty-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.report-empty-desc  { font-size: var(--text-sm); line-height: 1.65; max-width: 380px; margin: 0 auto var(--space-5); }

/* ── Loading ─────────────────────────────────────────────────── */
#report-loading {
  position: fixed; inset: 0;
  background-color: var(--bg-void);
  background-image: var(--bg-glossy-canvas);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: var(--space-4);
  z-index: 999; transition: opacity 0.3s;
}
.report-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Print / PDF styles ──────────────────────────────────────── */
@media print {
  .dash-sidebar,
  .report-actions,
  #report-loading { display: none !important; }

  .report-content { margin-left: 0 !important; padding: 0 !important; }
  .report-layout  { display: block !important; }

  .report-score-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .report-panel    { break-inside: avoid; border: 1px solid #dde5ef; }
  .report-grid-2   { grid-template-columns: 1fr 1fr; }

  body { background: #fff !important; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .report-score-banner { grid-template-columns: 1fr; text-align: center; }
  .report-banner-stats {
    flex-direction: row;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-left: 0;
    padding-top: var(--space-5);
    justify-content: center;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  .report-content  { margin-left: 0; padding: var(--space-5); }
  .report-grid-2   { grid-template-columns: 1fr; }
  .report-score-banner { padding: var(--space-6) var(--space-4); }
  .report-banner-stats {
    flex-direction: column;
    gap: var(--space-4);
  }
  .report-gauge    { margin: 0 auto; }
}
