/* Flow Explorer (Pilar 4, Fase 4) — design system custom, sem Tailwind.
   Reusa as vars de application.css (--neon-*, --color-*). */

.flows__intro {
  padding: 28px 0 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}
.flows__breadcrumb { margin-bottom: 10px; }
.flows__title {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text, #fff);
}
.flows__subtitle {
  color: var(--color-text-muted, #9aa);
  max-width: 720px;
  line-height: 1.5;
}
.flows__inline-link { color: var(--neon-cyan, #00E5FF); text-decoration: none; }
.flows__inline-link:hover { text-decoration: underline; }

/* ---- grid de cards ---- */
.flows__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.flow-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  padding: 18px;
  border-radius: 14px;
  background: var(--color-bg-card, #0d0d1a);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.flow-card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}
.flow-card__head { display: flex; align-items: center; gap: 10px; }
.flow-card__icon { font-size: 1.5rem; }
.flow-card__title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.flow-card__desc {
  color: var(--color-text-muted, #9aa);
  font-size: .9rem;
  line-height: 1.45;
  margin: 0;
}
.flow-card__lanes { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-card__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

/* ---- badges ---- */
.flow-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--color-bg-elevated, #141424);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted, #9aa);
}
.flow-badge--lane { text-transform: lowercase; }
.flow-badge--count { color: var(--neon-cyan, #00E5FF); }
.flow-badge--cost { color: var(--neon-amber, #FFC73B); }
.flow-badge--sm { padding: 1px 6px; font-size: .66rem; }

/* ---- subjects (chips seletores) ---- */
.flows__subjects {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 24px;
}
.flow-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--color-bg-card, #0d0d1a);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  max-width: 240px;
}
.flow-chip:hover { border-color: var(--color-border-strong); }
.flow-chip.is-active { border-color: var(--neon-cyan, #00E5FF); }
.flow-chip__label {
  font-size: .85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flow-chip__meta { font-size: .72rem; color: var(--color-text-muted, #9aa); }

/* ---- swimlanes ---- */
.flow-swim { margin-top: 8px; }
.flow-swim__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.flow-swim__title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.flow-swim__lanes { display: flex; flex-direction: column; gap: 14px; }

/* Raias agora são <details> colapsáveis (zero JS). O <summary> é o rótulo. */
.flow-lane {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: start;
}
/* Quando fechada, o <details> esconde o track sozinho; só o summary aparece. */
.flow-lane:not([open]) { grid-template-columns: 120px; }
.flow-lane__label {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-bg-elevated, #141424);
  border: 1px solid var(--color-border);
  cursor: pointer;
  list-style: none;
}
.flow-lane__label::-webkit-details-marker { display: none; }
.flow-lane__name { font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .04em; }
.flow-lane__count { font-size: .72rem; color: var(--color-text-muted, #9aa); }
.flow-lane__track {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: var(--color-bg-card, #0d0d1a);
  border: 1px dashed var(--color-border);
  min-height: 56px;
}
.flow-lane__empty { color: var(--color-text-muted, #556); align-self: center; }

.flow-node {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px;
  min-width: 160px;
  max-width: 220px;
  border-radius: 8px;
  background: var(--color-bg-elevated, #141424);
  border: 1px solid var(--color-border);
}
.flow-node__kind {
  font-size: .68rem; font-weight: 700;
  color: var(--neon-cyan, #00E5FF);
  text-transform: lowercase;
}
.flow-node__label { font-size: .8rem; line-height: 1.3; }
.flow-node__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}
.flow-node__time { font-size: .68rem; color: var(--color-text-muted, #9aa); }

/* ---- nó agrupado / sentinela elided ---- */
.flow-node--grouped {
  border-color: var(--neon-amber, #FFC73B);
  border-style: solid;
}
.flow-node--elided {
  border-style: dashed;
  border-color: var(--neon-cyan, #00E5FF);
  text-decoration: none;
  color: inherit;
  justify-content: center;
  min-width: 120px;
}
.flow-node--elided:hover { border-color: var(--color-border-strong); }

/* ---- header de resumo ---- */
.flow-summary {
  display: flex; flex-wrap: wrap; gap: 24px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--color-bg-card, #0d0d1a);
  border: 1px solid var(--color-border);
}
.flow-summary__item { display: flex; flex-direction: column; gap: 2px; }
.flow-summary__num { font-size: 1.3rem; font-weight: 700; }
.flow-summary__label { font-size: .72rem; color: var(--color-text-muted, #9aa); text-transform: uppercase; letter-spacing: .03em; }

/* ---- filtro por raia ---- */
.flow-lanefilter {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.flow-lanefilter__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  text-decoration: none;
  color: var(--color-text-muted, #9aa);
  background: var(--color-bg-elevated, #141424);
  border: 1px solid var(--color-border);
}
.flow-lanefilter__chip:hover { border-color: var(--color-border-strong); }
.flow-lanefilter__chip.is-active { border-color: var(--neon-cyan, #00E5FF); color: var(--color-text, #fff); }
.flow-lanefilter__n { font-size: .68rem; opacity: .7; }

/* ---- empty ---- */
.flows__empty {
  padding: 32px;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed var(--color-border);
  background: var(--color-bg-card, #0d0d1a);
}
.flows__empty-hint { color: var(--color-text-muted, #9aa); font-size: .85rem; margin-top: 6px; }

/* ---- mobile ---- */
@media (max-width: 640px) {
  .flow-lane { grid-template-columns: 1fr; }
  .flow-lane:not([open]) { grid-template-columns: 1fr; }
  .flow-node { min-width: 0; max-width: none; width: 100%; }
  .flow-summary { gap: 16px; }
}
