/*
 * Reports page — reuses every token/component class from
 * static/ops/dashboard.css (cards, pills, tables, status tiles); this
 * file only adds what's genuinely specific to the report itself: the
 * date-filter form layout and green/red P&L coloring.
 */

.rpt-filter-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rpt-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.rpt-filter-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ops-ink-faint);
  margin-bottom: 0;
}
.rpt-range-select {
  width: auto;
  min-width: 140px;
}
.rpt-custom-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rpt-custom-dates input[type="date"] {
  width: auto;
}
.rpt-period-caption {
  font-size: 11.5px;
}

.rpt-summary-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--ops-ink);
  font-variant-numeric: tabular-nums;
}

/* Module 7: token-based, not hardcoded hex -- consistent with the rest
   of the design system's --ok/--danger palette. */
.rpt-pnl-positive { color: var(--ok); }
.rpt-pnl-negative { color: var(--danger); }
.rpt-pnl-neutral  { color: var(--ops-ink-faint); }

/* ── KPI hierarchy (Module 7) — Net P&L + Win Rate are the strongest
   values on the page; everything else is a secondary, smaller tile. ──── */
.rpt-kpi-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  padding: 16px;
}
.rpt-kpi-hero-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rpt-kpi-hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ops-ink-faint);
}
.rpt-kpi-hero-value {
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.rpt-kpi-hero-sub {
  font-size: 11.5px;
  color: var(--ops-ink-soft);
}
.rpt-kpi-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.rpt-kpi-secondary-item {
  background: var(--ops-surface-2);
  border-radius: 4px;
  padding: 8px 10px;
}
.rpt-kpi-secondary-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ops-ink-faint);
  margin-bottom: 2px;
}
.rpt-kpi-secondary-value {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rpt-kpi-secondary-caption {
  font-size: 10px;
  color: var(--ops-ink-faint);
  margin-top: 1px;
}
.rpt-open-trades-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 16px;
}
.rpt-only-trade-banner {
  margin: 0 16px 16px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--ops-surface-2);
  font-size: 11.5px;
  color: var(--ops-ink-soft);
}

/* ── Charts (Module 7) — plain server-rendered inline SVG/HTML, never a
   charting library and never client-side P&L math. ──────────────────── */
.rpt-chart-card {
  padding: 14px 16px;
}
.rpt-chart-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ops-ink-faint);
  margin-bottom: 8px;
}
.rpt-cumulative-svg {
  width: 100%;
  height: 140px;
  display: block;
}
.rpt-bars-svg {
  width: 100%;
  height: 110px;
  display: block;
}
.rpt-distribution-bar {
  display: flex;
  width: 100%;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--ops-line);
}
.rpt-distribution-seg-win        { background: var(--ok); }
.rpt-distribution-seg-loss       { background: var(--danger); }
.rpt-distribution-seg-breakeven  { background: var(--ops-line-strong); }
.rpt-distribution-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ops-ink-soft);
}
.rpt-distribution-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}

/* Phase 5.1B-r3 item 5: a visible current/endpoint value next to the
   Cumulative Realized P&L title, and a shared accessible caption line
   under both line/bar charts -- updated on hover/focus of a per-point or
   per-bar hit-zone by static/reports/reports.js, which only ever copies
   already-server-rendered text between elements, never computes a value. */
.rpt-chart-endpoint {
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
}
.rpt-chart-caption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ops-ink-soft);
  min-height: 1.4em;
}
.rpt-chart-hitzone {
  cursor: pointer;
}
.rpt-cumulative-svg .rpt-chart-hitzone:hover,
.rpt-cumulative-svg .rpt-chart-hitzone:focus-visible {
  fill: var(--ops-surface-2);
}

@media (max-width: 767.98px) {
  .rpt-kpi-hero { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .rpt-filter-row { gap: 6px; }
  .rpt-range-select { min-width: 120px; }
  .rpt-kpi-hero-value { font-size: 26px; }
}
