/* Private Activity report: shared semantic colors on screen, white paper in print. */
.activity-report-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 24px;
  margin: 24px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.activity-report-entry > div {
  flex: 1 1 260px;
}
.activity-report-entry h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.activity-report-entry p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}
.activity-report-entry > p {
  flex-basis: 100%;
  font-size: 14px;
}
#app.activity-report-open > :not(.activity-report) {
  display: none;
}
.activity-report {
  max-width: 1280px;
  margin: 0 auto;
  color: var(--text-primary);
  font: 16px/1.6 var(--sans);
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.report-header {
  position: static;
  display: block;
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg);
}
.report-brand {
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
}
.report-header h2 {
  margin: 12px 0 8px;
  font-size: 36px;
  font-weight: 650;
  line-height: 1.2;
}
.report-header h2:focus {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.report-organization {
  font-size: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.report-period {
  margin: 8px 0 20px;
  color: var(--text-secondary);
}
.report-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-scope span {
  background: var(--bg-raised);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.report-kpi {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.report-kpi p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}
.report-kpi strong {
  display: block;
  margin: 12px 0;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.report-cost strong {
  font-size: 22px;
}
.report-cost small {
  display: block;
  color: var(--warn);
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}
.report-section {
  padding: 28px 32px;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.report-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.report-section h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}
.report-section-heading p {
  font-size: 13px;
}
.report-section p {
  color: var(--text-secondary);
  margin: 8px 0 20px;
}
.report-chart {
  margin: 24px 0;
}
.report-chart figcaption, .report-chart-labels {
  color: var(--text-secondary);
  font-size: 14px;
}
.report-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.report-chart-labels span:last-child {
  text-align: right;
}
.report-trend {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}
.report-grid {
  stroke: var(--border);
  fill: none;
}
.report-line {
  stroke: var(--chart-1);
  stroke-width: 3;
  fill: none;
}
.report-point {
  fill: var(--chart-1);
}
.report-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.report-section .report-scroll-hint {
  font-size: 13px;
  margin: 8px 0;
}
.report-table-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.report-table caption {
  text-align: left;
  color: var(--text-secondary);
  padding: 8px 0 16px;
  font-weight: 600;
}
.report-table th, .report-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.report-table thead th {
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-raised);
}
.report-table th:first-child {
  text-align: left;
  min-width: 160px;
  max-width: 400px;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.report-table td {
  min-width: 84px;
}
.report-table small {
  display: block;
  color: var(--warn);
  white-space: normal;
}
.report-metadata {
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.report-metadata summary {
  cursor: pointer;
  padding: 8px 0;
}
.report-metadata p {
  margin: 6px 0;
}
.report-retrieved {
  color: var(--text-secondary);
  font-size: 13px;
}
.report-footer {
  position: static;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.report-footer p {
  margin: 8px 0;
}
@media (max-width: 1100px) {
  .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 550px) {
  .report-header, .report-section, .report-kpi {
    padding: 20px;
  }
  .report-header h2 {
    font-size: 30px;
  }
  .report-kpis {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .report-actions .btn {
    flex: 1 1 140px;
  }
  .activity-report-entry .btn {
    width: 100%;
  }
}
@media print {
  @page {
    size: A4;
    margin: 16mm;
  }
  html:has(#activity-report) {
    background: #fff;
    color-scheme: light;
  }
  body:has(#activity-report) {
    --bg-surface: #fff;
    --bg-raised: #f1f3f8;
    --text-primary: #202432;
    --text-secondary: #444c5d;
    --border: #cbd0db;
    --accent: #5845bf;
    --accent-text: #5845bf;
    --chart-1: #5845bf;
    --warn: #724914;
    display: block;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #202432;
  }
  body:has(#activity-report) > :not(main) {
    display: none !important;
  }
  body:has(#activity-report) main {
    display: block;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none;
    width: 100%;
  }
  #app.activity-report-open > :not(.activity-report), .activity-report .report-actions {
    display: none !important;
  }
  .activity-report {
    width: 100%;
    max-width: none;
    font-size: 11pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .activity-report .report-header {
    padding: 20px;
    break-inside: avoid;
  }
  .activity-report .report-header h2 {
    outline: none;
    font-size: 28pt;
  }
  .activity-report .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    break-inside: avoid;
  }
  .activity-report .report-kpi {
    padding: 14px;
  }
  .activity-report .report-kpi strong {
    font-size: 22px;
    margin: 8px 0;
  }
  .activity-report .report-scroll-hint {
    display: none;
  }
  .activity-report .report-section {
    padding: 16px 0;
    border: 0;
    margin: 16px 0;
  }
  .activity-report .report-section-heading {
    break-after: avoid;
  }
  .activity-report .report-chart {
    break-inside: avoid;
  }
  .activity-report .report-table-scroll {
    overflow: visible;
  }
  .activity-report .report-table {
    width: 100%;
    table-layout: fixed;
    font-size: 9pt;
    break-inside: avoid;
  }
  .activity-report .report-table th, .activity-report .report-table td {
    padding: 9px 6px;
    min-width: 0;
    max-width: none;
    overflow-wrap: anywhere;
  }
  .activity-report .report-table th:first-child {
    width: 32%;
  }
  .activity-report .report-table th:last-child {
    width: 26%;
  }
  .activity-report thead {
    display: table-header-group;
  }
  .activity-report tr {
    break-inside: avoid;
  }
  .activity-report .report-footer {
    break-inside: avoid;
  }
  .activity-report .report-metadata > :not(summary) {
    display: block;
    content-visibility: visible;
  }
}
