/* Operations overview: three headline numbers, one large chart, weekly money. */

.ops-overview {
  position: relative;
  z-index: 0;
  --ops-ink: #0b1538;
  --ops-muted: #667085;
  --ops-border: #e5eaf2;
  --ops-card: #fff;
  --ops-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  --ops-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.4vw, 22px);
  inline-size: calc(100% - clamp(40px, 5vw, 88px));
  margin-inline: auto;
  color: var(--ops-ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- trend ---------- */

/* ---------- weekly money ---------- */

.ops-money {
  padding: clamp(14px, 1.3vw, 20px);
  border: 1px solid var(--ops-border);
  border-radius: var(--ops-radius);
  background: var(--ops-card);
  box-shadow: var(--ops-shadow);
}

.ops-money__head h2 {
  margin: 0;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 700;
}

.ops-money__head p {
  margin: 3px 0 12px;
  color: var(--ops-muted);
  font-size: 12.5px;
}

.ops-money__list { display: flex; flex-direction: column; gap: 8px; }

.ops-money__week {
  border: 1px solid var(--ops-border);
  border-radius: 10px;
  background: #fbfcfe;
  overflow: hidden;
}

.ops-money__week[open] { background: var(--ops-card); border-color: #c9d6ea; }

.ops-money__summary {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.ops-money__summary::-webkit-details-marker { display: none; }
.ops-money__summary:hover { background: #f4f8ff; }

.ops-money__range { font-size: 13.5px; font-weight: 650; }
.ops-money__range::before { content: "▸ "; color: var(--ops-muted); }
.ops-money__week[open] .ops-money__range::before { content: "▾ "; }

.ops-money__stat { display: flex; flex-direction: column; gap: 1px; font-size: 14px; font-weight: 600; }
.ops-money__stat i { color: var(--ops-muted); font-size: 11px; font-style: normal; font-weight: 600; }
.ops-money__stat--net { color: #027a48; }
.ops-money__stat--net[data-negative="true"] { color: #b42318; }

.ops-money__detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px 28px;
  padding: 4px 14px 16px;
  border-top: 1px solid var(--ops-border);
}

.ops-money__group h4 {
  margin: 12px 0 8px;
  color: var(--ops-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ops-money__lines { display: flex; flex-direction: column; gap: 6px; margin: 0; }

.ops-money__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}

.ops-money__line dt { color: var(--ops-muted); }
.ops-money__line dd { margin: 0; font-weight: 600; }

/* The recorded roll-up sits beside the lines it summarises rather than among
   them, because adding it to them would count the same dollars twice. */
.ops-money__line--rollup { padding-top: 6px; border-top: 1px dashed var(--ops-border); }
.ops-money__line--rollup dt { font-style: italic; }
.ops-money__line--sum { padding-top: 6px; border-top: 1px solid var(--ops-border); }
.ops-money__line--sum dt { color: var(--ops-ink); font-weight: 650; }

.ops-money__empty { margin: 0; padding: 18px 4px; color: var(--ops-muted); font-size: 13px; }

@media (max-width: 900px) {
  .ops-headline { grid-template-columns: minmax(0, 1fr); }
  .ops-money__summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- trend ---------- */

/* Read, not admired. 2px strokes, a desaturated palette, hairline grid, no
   fills and no glow - a chart that looks like a toy gets read like one. */
.ops-trend {
  inline-size: calc(100% - clamp(40px, 5vw, 88px));
  margin: clamp(14px, 1.4vw, 22px) auto 0;
  padding: clamp(16px, 1.5vw, 24px);
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  font-variant-numeric: tabular-nums;
}

.ops-trend__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ops-trend__head h2 {
  margin: 0;
  color: #0b1538;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 700;
}

.ops-trend__legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.ops-trend__key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: 12.5px;
  font-weight: 600;
}

.ops-trend__key i { width: 14px; height: 2px; border-radius: 1px; }

/* Big: this is the page's centrepiece, not a thumbnail. */
/* The SVG keeps its own aspect ratio - no preserveAspectRatio="none" anywhere
   near text - so the axis figures and week labels are never stretched. */
.ops-trend__canvas { inline-size: 100%; }
.ops-trend__svg { width: 100%; height: auto; display: block; overflow: visible; }

.ops-trend__grid { stroke: #eceff4; stroke-width: 1; }
.ops-trend__axis { fill: #8a94a6; font-size: 12px; }

.ops-trend__line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ops-trend__mark { stroke: #fff; stroke-width: 1; }

.ops-trend__empty {
  display: grid;
  place-items: center;
  block-size: 100%;
  margin: 0;
  color: #667085;
  font-size: 13px;
}

/* The weekly money sits under the trend on the same page and shares its width. */
.ops-money {
  inline-size: calc(100% - clamp(40px, 5vw, 88px));
  margin: clamp(14px, 1.4vw, 22px) auto clamp(20px, 2vw, 32px);
}
