/*
 * Job Finances "compared with" view (finance only) — the change figures under
 * each amount, the chips under a job's name, the "What moved" panel and the
 * "only show jobs that changed" switch. Print rules are in print.css.
 */

/* A change figure sits under the amount it qualifies, smaller and quieter
   than it, so the report still reads as the report. */
.sc-fin-delta {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sc-fin-delta.is-good { color: var(--sc-success); }
.sc-fin-delta.is-bad { color: var(--sc-danger); }
.sc-fin-delta.is-flat { color: var(--sc-fg-subtle); font-weight: 400; }

/* A changed row carries a left accent — the expense report's reconciled-line
   device — which a printer without background graphics still draws. */
.table-data tr.sc-fin-changed > td:first-child {
  box-shadow: inset 3px 0 0 var(--sc-fg-muted);
}

.table-data tr.sc-fin-ghost > td {
  color: var(--sc-fg-muted);
}

.table-data tr.sc-fin-ghost a {
  color: var(--sc-fg-muted) !important;
}

.sc-fin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.sc-fin-chips:empty {
  display: none;
}

.sc-fin-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--sc-border-strong);
  color: var(--sc-fg-muted);
  white-space: nowrap;
}

.sc-fin-chip.is-new { border-color: var(--sc-success); color: var(--sc-success); }
.sc-fin-chip.is-dropped { border-color: var(--sc-danger); color: var(--sc-danger); }
.sc-fin-chip.is-moved { border-style: dashed; color: var(--sc-fg); }
.sc-fin-chip.is-confirmed { color: var(--sc-success); }

.sc-fin-net-col {
  white-space: nowrap;
}

/* The switch. Rows are hidden, never removed, so the totals below them are
   untouched and turning it off brings every row straight back. */
.sc-fin-only-changes tr[data-fin-unchanged] {
  display: none;
}

/* ─── The panel ─────────────────────────────────────────────────────────── */
.sc-fin-changes .stat-number.sc-fin-stat {
  font-size: clamp(1.15rem, 1.9vw, 1.75rem);
  font-variant-numeric: tabular-nums;
}

.sc-fin-changes .stat-card .sc-fin-delta {
  font-size: 0.9rem;
}

.sc-fin-movers li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--sc-border);
  font-size: 0.875rem;
}

.sc-fin-movers li:last-child {
  border-bottom: 0;
}

.sc-fin-mover-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sc-fin-mover-figure {
  text-align: right;
  flex-shrink: 0;
}

.sc-fin-trend {
  position: relative;
  height: 220px;
}
