/* PO Date Movement (Merchandising) -- AFI acknowledged-arrival-date churn.
 *
 * Ported from the approved prototype
 * (_outbox/PROTOTYPE_PO_Date_Movement_2026-09-25.html, Wayne 2026-09-25) with
 * one instruction carried through: NO explanatory prose on the surface. Every
 * caption, footnote and helper sentence was stripped; the numbers, the labels
 * and the layout carry the meaning. Anything that reads like a sentence
 * belongs in a report, not on a view.
 *
 * THE ONE STRUCTURAL RULE. "Bounced" counts lines that moved BOTH later and
 * earlier before landing, so it overlaps all three net buckets and is NOT a
 * fourth slice. It gets its OWN bar (.pd-ovl-*) below the three-way
 * composition bar, with its own legend row, never a fourth .pd-seg. Do not
 * "simplify" it into the composition bar -- scripts/validate/test_podates_tie.py
 * fails the build if the bar ever carries four segments.
 */

/* ── filter row (dropdowns, never tab rows) ────────────────────────── */
.pd-filters {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 12px;
  background: #fff; border: 1px solid #e2e5e9; border-radius: 10px;
  box-shadow: var(--shadow);
}
.pd-fg { display: flex; align-items: center; gap: 6px; }
.pd-fg label {
  font-size: 10px; color: #6b7280; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.pd-fg select, .pd-fg input {
  padding: 4px 8px; border: 1px solid var(--table-border); border-radius: 6px;
  font-size: 12px; font-family: var(--font-stack); background: #fff; color: var(--navy);
}
.pd-fg select:hover { background: var(--icy-blue); border-color: var(--primary-blue); }
.pd-fg select:focus, .pd-fg input:focus {
  outline: none; border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(63, 115, 141, 0.15);
}
.pd-stamp {
  margin-left: auto; font-size: 11px; font-weight: 600; color: #4b5563;
  background: #eef3f6; border-radius: 6px; padding: 4px 9px;
}
.pd-stamp.stale { background: var(--signal-yellow-bg); color: var(--signal-yellow-text); }

/* ── KPI row (same navy tiles as Sales Performance) ────────────────── */
.pd-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
/* The shared .kpi-sub carries no colour of its own -- it exists for the
 * vs-LY variants (.pos / .neg) on Sales Performance, and a plain sub-line
 * inherits the page's near-black text, which is invisible on the navy tile.
 * Scoped to this view so nothing else moves. The sub-lines stay: Wayne kept
 * them in the 2026-09-25 strip-the-prose pass (they are numbers and a date
 * range, not prose). */
.pd-kpis .kpi-sub { color: rgba(255, 255, 255, 0.62); }
/* One tile's label wraps to two lines ("Net earlier than first promised").
 * A min-height keeps all five VALUES on the same baseline instead of one
 * tile's number sitting a line lower than the rest. */
.pd-kpis .kpi-label { min-height: 28px; line-height: 1.25; }
@media (max-width: 1100px) { .pd-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ── cards ─────────────────────────────────────────────────────────── */
.pd-two { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .pd-two { grid-template-columns: 1fr; } }
.pd-card {
  background: #fff; border: 1px solid #e2e5e9; border-radius: 10px;
  box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden;
}
.pd-head {
  padding: 11px 16px; border-bottom: 1px solid #eceff2;
  display: flex; align-items: center; gap: 12px;
}
.pd-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: #334155; }
.pd-count {
  margin-left: auto; font-size: 11.5px; color: #8a949e;
  font-variant-numeric: tabular-nums;
}
.pd-body { padding: 14px 16px; }

/* ── composition bar: EXACTLY three mutually exclusive segments ────── */
.pd-comp { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid #d9dfe4; }
.pd-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap;
}
.pd-legend { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.pd-lg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #374151; }
.pd-sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
/* Hatched, and on its own track, so bounced reads as a separate measure. */
.pd-sw.hatch, .pd-ovl-fill {
  background: repeating-linear-gradient(135deg, #B08A57 0 5px, #C9A876 5px 10px);
}
.pd-ovl { margin-top: 16px; }
.pd-ovl-track {
  height: 20px; border-radius: 5px; background: #eef2f5;
  border: 1px solid #d9dfe4; overflow: hidden;
}
.pd-ovl-fill { height: 100%; }

/* ── re-promise distribution ───────────────────────────────────────── */
.pd-dist {
  display: grid; grid-template-columns: 78px 1fr 112px;
  align-items: center; gap: 10px; margin-bottom: 7px; font-size: 12.5px;
}
.pd-dist-l { color: #4b5563; font-weight: 600; }
.pd-dist-t { background: #eef2f5; border-radius: 4px; height: 18px; overflow: hidden; }
.pd-dist-f { height: 100%; background: var(--primary-blue); }
.pd-dist-f.hot { background: #9B4B3F; }
.pd-dist-v { text-align: right; color: #374151; font-variant-numeric: tabular-nums; }
.pd-muted { color: #98a1a9; }

/* ── weekly chart ──────────────────────────────────────────────────── */
.pd-chart { overflow-x: auto; }

/* ── tables ────────────────────────────────────────────────────────── */
.pd-scroll { max-height: 470px; overflow: auto; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-family: var(--font-stack); }
.pd-table th {
  background: var(--table-header-bg); color: var(--navy); font-weight: 600;
  text-align: left; padding: 9px 12px; cursor: pointer; user-select: none;
  white-space: nowrap; position: sticky; top: 0; z-index: 10; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 2px solid #e2e5e9;
}
.pd-table th.num, .pd-table td.num { text-align: right; }
.pd-table td {
  padding: 7px 12px; border-bottom: 1px solid #f1f3f5;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pd-table tbody tr:hover td { background: var(--light-bg); }
.pd-table tr.dc td:first-child { font-weight: 600; }
.pd-table tfoot td {
  background: var(--navy); color: #fff; font-weight: 700;
  border: none; position: sticky; bottom: 0;
}
.pd-locrow, .pd-drillrow { cursor: pointer; }
.pd-drillrow td:first-child { color: var(--primary-blue); font-weight: 600; }
.pd-pos { color: var(--signal-red-text); font-weight: 700; }
.pd-neg { color: var(--signal-green-text); font-weight: 700; }
.pd-pat { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: #eef2f5; color: #4b5563; }

/* ── expanded change trail ─────────────────────────────────────────── */
.pd-trail td { background: #fbfcfd; padding: 0; border-bottom: 1px solid #eceff2; }
.pd-trail-in { padding: 10px 14px 12px 34px; }
.pd-mv {
  display: grid; grid-template-columns: 190px 96px 1fr; gap: 8px;
  font-size: 12px; padding: 3px 0; border-bottom: 1px dotted #e5e9ec;
}
.pd-mv .d { font-variant-numeric: tabular-nums; }
.pd-mv .up { color: var(--signal-red-text); font-weight: 700; }
.pd-mv .dn { color: var(--signal-green-text); font-weight: 700; }
.pd-mv .ts { color: #8a949e; }
.pd-mv.head span {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: #6b7280;
}
.pd-mv.gap span { color: #98a1a9; }

.pd-empty { padding: 40px 16px; text-align: center; color: #6b7280; font-size: 14px; }
