/* =========================================================================
   ATTRITION & BACKFILL DEMO (#attritionBackfillDemo).
   See src/components/AttritionBackfillDemo.astro for the storyboard.
   Timeline: public/js/attrition-backfill-demo.js toggles `is-*` classes
   and positions `.abd__cursor` at runtime.

   A single steady scene, no crossfade — a department plan table (flex
   rows) with a stat card beneath it. Same --xxx-canvas/card/border/
   accent palette (product likeness) as every other demo on the site.
   ========================================================================= */

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

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

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

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

.abdHead { margin-bottom: 8px; }
.abdHead__title { font-size: 12px; font-weight: 600; color: var(--abd-ink); }

.abdTable { background: var(--abd-card); border: 1px solid var(--abd-border); border-radius: 8px; overflow: hidden; }
.abdRow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font-size: 9.5px; color: var(--abd-ink2);
  border-bottom: 1px solid var(--abd-line);
  transition: background .3s ease;
}
.abdTable > .abdRow:last-child { border-bottom: none; }
.abdRow__name { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-weight: 600; color: var(--abd-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abdRow__role { font-size: 8px; font-weight: 500; color: var(--abd-ink2); }
.abdRow--muted { background: #FCFCFB; }
.abdRow--flag { background: var(--abd-red-soft); }

.abdRow__tag {
  flex: none; font-size: 8px; font-weight: 600; color: var(--abd-ink2);
  background: var(--abd-head); border: 1px solid var(--abd-border); border-radius: 999px;
  padding: 3px 8px; white-space: nowrap;
}
.abdRow__tag--depart { color: var(--abd-red); background: #fff; border-color: #F0C9C2; }

.abdRow__tagPill {
  flex: none; font-size: 8px; font-weight: 600; color: var(--abd-ink2);
  background: var(--abd-head); border: 1px solid var(--abd-border); border-radius: 999px;
  padding: 3px 8px; white-space: nowrap;
  transition: background .3s ease, border-color .3s ease, color .3s ease, transform .15s ease;
}
.abd.is-press-tag [data-el="tagBackend"] { transform: scale(.94); }
.abd.is-tagged [data-el="tagBackend"] { background: var(--abd-accent-soft); border-color: #CFC7EF; color: var(--abd-accent); }
.abd.is-tagged [data-el="reqBackend"] { background: var(--abd-accent-soft); }

.abdStat {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 9px; padding: 8px 10px;
  background: var(--abd-head); border: 1px solid var(--abd-border); border-radius: 8px;
  font-size: 9.5px; font-weight: 600; color: var(--abd-ink2);
  transition: background .3s ease, border-color .3s ease;
}
.abdStat span:last-child { font-size: 13px; font-weight: 700; color: var(--abd-ink); font-variant-numeric: tabular-nums; }
.abd.is-stat-flash .abdStat { background: var(--abd-accent-soft); border-color: #CFC7EF; }
.abd.is-stat-flash .abdStat span:last-child { color: var(--abd-accent); }

.abd__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;
}
.abd.is-cursor-visible .abd__cursor { opacity: 1; }

@media (max-width: 460px) {
  .abd__stage { aspect-ratio: auto; min-height: 440px; }
  .abdRow { padding: 7px 8px; font-size: 8.5px; }
}
