/* Dashboard Stage bar-chart layout — P3.1-002.
 *
 * Static layout only. Each bar's STAGE colour (background/border) and its
 * width-percent are dynamic and supplied server-side as an inline `style`
 * attribute (STAGE_STYLE_WEB is the single colour source-of-truth; hard-
 * coding 13 stage classes here would risk byte-drift). Consumes the
 * tokens.css custom properties. No remote font rules, no cross-file CSS
 * includes, no url() — the offline workstation (INV-4) fetches nothing.
 */

.stage-chart {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-4) 0;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.stage-chart .bar-label {
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
}

.stage-chart .bar-track {
  position: relative;
  height: 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stage-chart .bar {
  /* width + background + border-color arrive inline (dynamic stage
     colour); only the static box model lives here. */
  height: 100%;
  min-width: 2px;
  border-right: 2px solid transparent;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.stage-chart .bar-count {
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.stage-chart .bar-empty {
  grid-column: 1 / -1;
  color: var(--muted);
}

/* --- Overview stat cards (P3.1-005; .stat-card promoted to console.css) -- */
/* The fragment wraps each dt/dd pair in a .stat-card div (valid HTML —
   div grouping inside dl); this dl lays the cards out as a grid (it is the
   htmx refresh target id). The .stat-card surface + dt/dd typography are
   the console.css SSOT (P3.3-008), shared with the other pages' stat
   cards — not re-declared here to avoid byte-drift between two palettes. */

#overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
}

/* --- Suspected-DPRK-wallet summary (P3.3 #2) ------------------------------ */
/* The actor headline + the per-address attribution evidence table. Reuses the
   global .console-card / .status-badge (console.css); only the wallet-specific
   bits live here. */
.suspect-actor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-3);
}

.suspect-actor-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
}

.suspect-aliases {
  color: var(--muted);
  font-size: 0.85rem;
}

.suspect-intro {
  margin: var(--space-3) 0 var(--space-2);
  color: var(--muted);
  font-size: 0.85rem;
}

.suspect-table {
  width: 100%;
}

.suspect-table .suspect-addr {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.suspect-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Money-laundering flow stages (P3.3-021 #4) -------------------------- */
/* A designed, numbered stage-flow projecting the reporting STAGE_* glossary
   (build_laundering_flow). Each step's accent (--lf-color) is the
   STAGE_STYLE_WEB stroke, supplied inline server-side (the stage-bar / heatmap
   colour SSOT); only the static layout lives here, on tokens, both themes. The
   dashboard does not load pages.css, so these mirror the report overview-flow
   strip rather than reuse it. */
.lf-intro {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  font-size: 0.85rem;
}

.laundering-flow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.laundering-flow .lf-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex: 1 1 11rem;
  min-width: 10rem;
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--lf-color, var(--accent));
  border-radius: var(--radius-md);
}

/* The → flow arrow between consecutive steps, sitting in the wider row gap. */
.laundering-flow .lf-step:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  right: calc(-1 * var(--space-4) - 1px);
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  font-size: 1.5rem;
  color: var(--muted);
  pointer-events: none;
}

.laundering-flow .lf-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--lf-color, var(--accent));
  color: #fff;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
}

.laundering-flow .lf-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.laundering-flow .lf-stage {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--heading);
}

.laundering-flow .lf-behavior {
  font-size: 0.8rem;
  color: var(--muted);
}

.laundering-flow .lf-asset {
  font-size: 0.78rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Stack the steps on narrow screens and drop the horizontal arrows. */
@media (max-width: 700px) {
  .laundering-flow .lf-step {
    flex-basis: 100%;
  }
  .laundering-flow .lf-step:not(:last-child)::after {
    content: none;
  }
}
