/* ==========================================================================
   TeamTrek — the effort bars
   --------------------------------------------------------------------------
   The project-performance instrument, inside the shared panel frame.

   A project's total says whether it ran long. What it was made of says why,
   and whether the next one of its kind is worth taking. So the bar is a
   project cut by the kind of work inside it: building the thing, doing it
   again, talking about it, and the paperwork around it.

   Bars share one scale, so a long project is long. The segments keep the
   same order on every row, because the figure is read down a column --
   rework against rework -- rather than along a timeline.

   The frame around it lives in panel.css. Everything here is the
   instrument.
   ========================================================================== */
.eff {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: .875rem .875rem .5rem;
}

.eff__head,
.eff__row {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) 4.5rem 4rem;
  gap: .75rem;
  align-items: center;
}
.eff__head {
  margin: 0 0 .5rem;
  font-size: .625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--neutral-500);
}
.eff__head span:nth-child(n+3) { text-align: right; }

/* ------------------------------------------------------------- the rows */
.eff__rows { display: grid; grid-auto-rows: minmax(0, 1fr); gap: .375rem; min-height: 0; }

.eff__who { min-width: 0; font-size: .75rem; color: var(--neutral-500); }
.eff__who b {
  display: block;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.eff__bar {
  position: relative;
  display: flex; gap: 2px;
  height: 24px;
  border-radius: var(--r-xs);
  background: var(--neutral-100);
}
.eff__seg {
  flex: 0 0 auto;
  width: calc(var(--w, 0) * 1%);
  border-radius: 2px;
  transition: background-color var(--dur-ui) var(--ease-ui);
}
.eff__seg--build    { background: var(--primary-700); }
/* Work done a second time. Its own tone rather than a warning colour: the
   figure states how much there was, and whether that is too much is the
   reader's judgement, not the chart's. */
.eff__seg--rework   { background: var(--primary-400); }
.eff__seg--meetings { background: var(--primary-200); }
.eff__seg--admin    { background: var(--primary-100); box-shadow: inset 0 0 0 1px var(--primary-200); }

/* What the project was estimated at, across its own bar. */
.eff__est {
  position: absolute; top: -3px; bottom: -3px;
  left: calc(var(--e, 100) * 1%);
  width: 0;
  border-left: 2px dashed var(--neutral-400);
}

/* The kind of work being read, from the rail. */
.eff__seg.is-now { box-shadow: inset 0 0 0 2px var(--primary-800); }

.eff__hours {
  text-align: right;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.eff__gap {
  text-align: right;
  font-size: .8125rem; font-weight: 700; color: var(--primary-700);
  font-variant-numeric: tabular-nums;
}
.eff__gap--under { color: var(--neutral-600); }

/* --------------------------------------------------------------- the key */
.eff__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .375rem 1rem;
  margin: .75rem 0 0; padding-top: .625rem;
  border-top: 1px solid var(--neutral-150);
  font-size: .625rem; color: var(--neutral-500);
}
.eff__key { display: inline-flex; align-items: center; gap: .375rem; }
.eff__key i { width: 11px; height: 11px; border-radius: 3px; background: var(--primary-700); }
.eff__key--rework i   { background: var(--primary-400); }
.eff__key--meetings i { background: var(--primary-200); }
.eff__key--admin i    { background: var(--primary-100); box-shadow: inset 0 0 0 1px var(--primary-200); }
.eff__key--est i {
  width: 0; height: 13px; border-radius: 0; background: none;
  border-left: 2px dashed var(--neutral-400);
}

@media (prefers-reduced-motion: reduce) {
  .eff__seg { transition: none; }
}

/* ------------------------------------------------------------- narrower */
@media (max-width: 959px) {
  .eff { padding: .75rem .75rem .5rem; }
  .eff__head,
  .eff__row { grid-template-columns: 8rem minmax(0, 1fr) 4rem 3.5rem; }
  .eff__rows { grid-auto-rows: 40px; }
}

/* --------------------------------------------------------------- phones */
@media (max-width: 599px) {
  .eff { padding: .625rem .5rem .5rem; }
  .eff__head,
  .eff__row { grid-template-columns: 6rem minmax(0, 1fr) 3.5rem 3rem; gap: .5rem; }
  .eff__head { font-size: .75rem; letter-spacing: .04em; }
  .eff__who b { font-size: .75rem; }
  .eff__who { font-size: 0; }
  .eff__hours,
  .eff__gap { font-size: .75rem; }
  .eff__foot { font-size: .75rem; gap: .25rem .75rem; }
}
