/* =========================================================================
   ROSTER LOAD DEMO (#rosterLoadDemo).
   See src/components/RosterLoadDemo.astro for the storyboard.
   Timeline: public/js/roster-load-demo.js toggles `is-*` classes and
   positions `.rld__cursor` at runtime.

   A single steady scene, no crossfade — a row-level roster (flex rows,
   same pattern as QuotaReconcileDemo's .qrdTable) with an assumption
   chip row above it and a push-open detail row beneath the opened
   employee, same push-open language as QuotaReconcileDemo's .qrdDetail.
   Same --xxx-canvas/card/border/accent palette (product likeness) as
   every other demo on the site.
   ========================================================================= */

.rld {
  --rld-canvas: #FAF9F5;
  --rld-card: #FFFFFF;
  --rld-border: #DBDBDE;
  --rld-line: #EAEAEA;
  --rld-head: #F6F6F7;
  --rld-ink: #2B2B2B;
  --rld-ink2: #777777;
  --rld-accent: #6A5BC6;
  --rld-accent-soft: #ECECFF;
}

.rld__stage {
  position: relative; overflow: hidden; width: 100%;
  aspect-ratio: 3 / 2; min-height: 380px; max-width: 640px; margin: 0 auto;
  background: var(--rld-canvas);
  display: flex; flex-direction: column;
  transition: opacity .5s ease;
}
.rld.is-out .rld__stage { opacity: 0; }

.rld__topBar {
  flex: none; font-size: 11px; font-weight: 600; color: var(--rld-ink);
  padding: 12px 14px 9px; border-bottom: 1px solid var(--rld-line);
  white-space: nowrap;
}

.rld__pane { flex: 1; min-height: 0; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }

.rldHead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rldHead__title { font-size: 12px; font-weight: 600; color: var(--rld-ink); }
.rldHead__sub { font-size: 9.5px; color: var(--rld-ink2); }

/* ---------- assumption chips — the rates the loaded cost is built from. ---------- */
.rldAssumptions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.rldChip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 8.5px; color: var(--rld-ink2);
  background: var(--rld-card); border: 1px solid var(--rld-border); border-radius: 999px;
  padding: 4px 9px;
}
.rldChip b { font-size: 9.5px; font-weight: 700; color: var(--rld-ink); }

/* ---------- roster table ---------- */
.rldTable { background: var(--rld-card); border: 1px solid var(--rld-border); border-radius: 8px; overflow: hidden; }
.rldRow {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; font-size: 9.5px; color: var(--rld-ink2);
  border-bottom: 1px solid var(--rld-line);
  opacity: 0; transform: translateY(5px);
  transition: opacity .35s ease, transform .35s ease, background .3s ease;
}
.rldTable > .rldRow:last-of-type { border-bottom: none; }
.rldRow.is-shown { opacity: 1; transform: none; }
.rldRow--head { opacity: 1; transform: none; background: var(--rld-head); font-weight: 500; border-bottom: 1px solid var(--rld-border); }
.rld.is-press-priya [data-el="row-priya"] { background: var(--rld-accent-soft); }

.rldRow__name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; font-weight: 600; color: var(--rld-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rldRow--head .rldRow__name { font-weight: 500; color: var(--rld-ink2); }
.rldRow__band {
  flex: none; font-size: 7.5px; font-weight: 600; color: var(--rld-ink2);
  background: var(--rld-head); border: 1px solid var(--rld-line); border-radius: 3px;
  padding: 1px 4px; letter-spacing: .03em;
}
.rldRow__geo { flex: none; width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rldRow__val { flex: none; width: 58px; text-align: right; font-variant-numeric: tabular-nums; color: var(--rld-ink); }
.rldRow--head .rldRow__val { color: var(--rld-ink2); }

/* ---------- the loaded-cost breakdown, pushed open beneath the row. ---------- */
.rldDetail {
  max-height: 0; overflow: hidden;
  padding: 0 12px; background: var(--rld-accent-soft);
  transition: max-height .45s ease, padding .45s ease;
}
.rld.is-drilled .rldDetail { max-height: 110px; padding: 8px 12px 10px; }
.rldDetail__row { display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: var(--rld-ink2); padding: 2px 0; }
.rldDetail__row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--rld-ink); }
.rldDetail__row--total { margin-top: 3px; padding-top: 5px; border-top: 1px solid #CFC7EF; }
.rldDetail__row--total span { font-weight: 700; color: var(--rld-accent); font-size: 10px; }

.rld__cursor {
  position: absolute; opacity: 0; pointer-events: none; z-index: 9;
  transition: left .6s cubic-bezier(.5, .05, .3, 1), top .6s cubic-bezier(.5, .05, .3, 1), opacity .3s ease;
}
.rld.is-cursor-visible .rld__cursor { opacity: 1; }

@media (max-width: 460px) {
  .rld__stage { aspect-ratio: auto; min-height: 440px; }
  .rldRow__geo { width: 64px; }
  .rldRow { padding: 6px 7px; font-size: 8.5px; }
}
