/* ═════════════════════════════════════════════════════════════════════════════
   js/install-ops-v2.css — WIP-UI-INSTALL-OPS-01
   Final Sign Off + Installation Schedule visual rebuild.
   Classes namespaced .iop-* (install-ops) so they don't collide with existing
   jobs/install markup. Pulses + animations gated by prefers-reduced-motion.
   ═════════════════════════════════════════════════════════════════════════════ */

:root {
  --iop-ok-fg: #15803D;
  --iop-ok-bg: #DCFCE7;
  --iop-ok-light: #22C55E;
  --iop-ok-deep: #166534;
  --iop-due-fg: #DC2626;
  --iop-due-bg: #FEE2E2;
  --iop-due-light: #EF4444;
  --iop-due-deep: #991B1B;
  --iop-warn-fg: #D97706;
  --iop-warn-bg: #FEF3C7;
  --iop-warn-light: #F59E0B;
  --iop-warn-deep: #92400E;
  --iop-info-fg: #1D4ED8;
  --iop-info-bg: #DBEAFE;
  --iop-info-light: #3B82F6;
  --iop-purple: #7C3AED;
  --iop-purple-bg: #F3E8FF;
  --iop-purple-light: #A855F7;
}

@keyframes iop-pulse-urgent-red {
  0%, 100% { box-shadow: inset 3px 0 0 0 var(--iop-due-fg),    0 0 0 0 rgba(220,38,38,.4); }
  50%      { box-shadow: inset 3px 0 0 0 var(--iop-due-light), 0 0 0 5px rgba(220,38,38,0); }
}
@keyframes iop-pulse-warn-yellow {
  0%, 100% { box-shadow: inset 3px 0 0 0 var(--iop-warn-fg),    0 0 0 0 rgba(217,119,6,.3); }
  50%      { box-shadow: inset 3px 0 0 0 var(--iop-warn-light), 0 0 0 4px rgba(217,119,6,0); }
}
@keyframes iop-pulse-dot-red    { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.6); } 50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); } }
@keyframes iop-pulse-dot-yellow { 0%,100% { box-shadow: 0 0 0 0 rgba(217,119,6,.5); } 50% { box-shadow: 0 0 0 5px rgba(217,119,6,0); } }
@keyframes iop-pulse-risk-red   { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); } 50% { box-shadow: 0 0 0 5px rgba(220,38,38,0); } }
@media (prefers-reduced-motion: reduce) {
  .iop-page .fso-row.pulse-urgent, .iop-page .fso-row.pulse-warn,
  .iop-page .age-pulse-dot, .iop-page .crew-chip.over,
  .iop-page .job-card.at-risk, .iop-page .status-dot.pulse-red,
  .iop-page .now-line::before, .iop-page .now-line {
    animation: none !important;
  }
}

/* ─── Page chassis ─────────────────────────────────────────────────── */
.iop-page { padding: 4px 0 32px; font-family: 'Archivo', system-ui, sans-serif; }

/* ─── HERO ─────────────────────────────────────────────────────────── */
.iop-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--s200, #E7E5E4); flex-wrap: wrap;
}
.iop-hero-l { display: flex; flex-direction: column; gap: 6px; }
.iop-hero-eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--s500, #78716C);
}
.iop-hero-title {
  font-size: 36px; font-weight: 900; letter-spacing: -0.04em;
  color: var(--ink, #0A0A0A); line-height: 1;
}
.iop-hero-sub {
  font-size: 15px; font-weight: 700; color: var(--s500, #78716C);
  margin-top: 4px; letter-spacing: -0.005em;
}
.iop-hero-sub b { color: var(--ink, #0A0A0A); font-weight: 900; }
.iop-hero-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.iop-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap;
  cursor: pointer; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.iop-btn-w {
  background: #fff; color: var(--s700, #44403C);
  border-color: var(--s200, #E7E5E4); box-shadow: var(--shadow-rest);
}
.iop-btn-w:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); }
.iop-btn-d { background: var(--ink, #0A0A0A); color: #fff; border-color: var(--ink, #0A0A0A); }
.iop-btn-d:hover { background: var(--s900, #1C1917); }
.iop-btn-r {
  background: var(--fos-plate); color: var(--fos-on-plate); border-color: var(--fos-plate);
  box-shadow: 0 1px 2px rgba(250,204,21,.2), 0 4px 12px -4px rgba(250,204,21,.4);
}
.iop-btn-r:hover { background: var(--fos-plate-hover); color: var(--fos-on-plate); }
.iop-btn-ok { background: var(--iop-ok-fg); color: #fff; border-color: var(--iop-ok-fg); }
.iop-btn-ok:hover { background: var(--iop-ok-deep); }

/* ─── FSO KPI band (4 cards) ───────────────────────────────────────── */
.iop-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 18px;
}
@media (max-width: 1100px) { .iop-kpi-row { grid-template-columns: repeat(2, 1fr); } }
.iop-kpi-row.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1400px) { .iop-kpi-row.cols-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .iop-kpi-row.cols-5 { grid-template-columns: repeat(2, 1fr); } }

.iop-kpi {
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--shadow-rest);
  transition: all 180ms cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.iop-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: var(--s300, #D6D3D1); }
.iop-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.iop-kpi.awaiting::before  { background: var(--iop-due-fg); }
.iop-kpi.inprogress::before { background: var(--iop-warn-fg); }
.iop-kpi.signed::before    { background: var(--iop-ok-fg); }
.iop-kpi.value::before     { background: var(--ink, #0A0A0A); }
.iop-kpi.revenue::before   { background: var(--red, #a16207); }
.iop-kpi.frames::before    { background: var(--iop-info-fg); }
.iop-kpi.jobs::before      { background: var(--iop-purple); }
.iop-kpi.hours::before     { background: var(--iop-ok-fg); }
.iop-kpi.zip::before       { background: var(--iop-warn-fg); }

.iop-kpi-eyebrow {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--s500, #78716C);
  display: flex; align-items: center; gap: 6px; margin-bottom: 5px;
}
.iop-kpi-num {
  font-size: 28px; font-weight: 900; letter-spacing: -0.035em;
  line-height: 1; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 5px;
}
.iop-kpi-num .unit { font-size: 12px; font-weight: 700; color: var(--s500, #78716C); }
.iop-kpi.awaiting  .iop-kpi-num { color: var(--iop-due-fg); }
.iop-kpi.inprogress .iop-kpi-num { color: var(--iop-warn-fg); }
.iop-kpi.signed    .iop-kpi-num { color: var(--iop-ok-fg); }
.iop-kpi.value     .iop-kpi-num { color: var(--ink, #0A0A0A); }
.iop-kpi.revenue   .iop-kpi-num { color: var(--red, #a16207); }
.iop-kpi.frames    .iop-kpi-num { color: var(--iop-info-fg); }
.iop-kpi.jobs      .iop-kpi-num { color: var(--iop-purple); }
.iop-kpi.hours     .iop-kpi-num { color: var(--iop-ok-fg); }
.iop-kpi.zip       .iop-kpi-num { color: var(--iop-warn-fg); }
.iop-kpi-bar {
  height: 4px; background: var(--s100, #F5F5F4); border-radius: 3px;
  overflow: hidden; margin-top: 9px;
}
.iop-kpi-bar-fill { height: 100%; border-radius: 3px; }
.iop-kpi.revenue .iop-kpi-bar-fill { background: linear-gradient(90deg, var(--red, #a16207), var(--red-dark, #854d0e)); }
.iop-kpi.frames  .iop-kpi-bar-fill { background: linear-gradient(90deg, var(--iop-info-light), var(--iop-info-fg)); }
.iop-kpi.jobs    .iop-kpi-bar-fill { background: linear-gradient(90deg, var(--iop-purple-light), var(--iop-purple)); }
.iop-kpi.hours   .iop-kpi-bar-fill { background: linear-gradient(90deg, var(--iop-ok-light), var(--iop-ok-fg)); }
.iop-kpi.zip     .iop-kpi-bar-fill { background: linear-gradient(90deg, var(--iop-warn-light), var(--iop-warn-fg)); }
.iop-kpi-foot {
  font-size: 10.5px; color: var(--s500, #78716C); font-weight: 700;
  margin-top: 6px;
}
.iop-kpi-foot b { color: var(--ink, #0A0A0A); font-weight: 800; }

/* ─── SC-B7: Week Revenue exclusion rows ─────────────────────────────
   Brendan looked straight at this tile and still believed he had $47.4k
   of work next week. The excluded $28.8k WAS on screen — appended to the
   end of the "of $175,000 target ·" line, where it read as a footnote
   about the target. So each excluded (or reclassified) bucket now gets
   its own line: label, money, what it is. Three columns, one row each,
   no chrome — the money is the only thing that needs to catch the eye. */
.iop-kpi-excs {
  margin-top: 8px; padding-top: 7px;
  border-top: 1px solid var(--s100, #F5F5F4);
  display: flex; flex-direction: column; gap: 3px;
}
.iop-kpi-exc {
  display: grid; grid-template-columns: auto auto 1fr;
  align-items: baseline; gap: 6px;
  font-size: 10.5px; font-weight: 700; color: var(--s500, #78716C);
}
.iop-kpi-exc-k {
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--s400, #A8A29E);
}
.iop-kpi-exc-v {
  font-variant-numeric: tabular-nums; font-weight: 800;
  color: var(--s600, #57534E);
}
.iop-kpi-exc-n { color: var(--s500, #78716C); font-weight: 600; min-width: 0; }
/* Money the SC-B7 rule pulled back IN reads as a credit, not an exclusion. */
.iop-kpi-exc.is-in .iop-kpi-exc-k { color: var(--iop-ok-fg); }
.iop-kpi-exc.is-in .iop-kpi-exc-v { color: var(--iop-ok-fg); }

/* ─── FSO toolbar (filter chips + search) ───────────────────────────── */
.iop-toolbar {
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 11px; padding: 8px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 16px;
  box-shadow: var(--shadow-rest);
}
.iop-tb-l { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; min-width: 0; }
.iop-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700;
  color: var(--s700, #44403C); background: var(--s50, #FAFAF9);
  border: 1px solid var(--s100, #F5F5F4); cursor: pointer;
  font-family: inherit; letter-spacing: -0.005em;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-chip:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); }
.iop-chip.on { background: var(--ink, #0A0A0A); color: #fff; border-color: var(--ink, #0A0A0A); }
.iop-chip .c {
  font-size: 9.5px; font-weight: 800; padding: 1px 5px;
  border-radius: 4px; background: rgba(0,0,0,.06);
  color: var(--s600, #57534E); margin-left: 2px;
}
.iop-chip.on .c { background: rgba(255,255,255,.18); color: #fff; }
.iop-chip.urgent .c { background: var(--iop-due-bg); color: var(--iop-due-fg); }
.iop-chip.urgent.on .c { background: rgba(255,255,255,.25); color: #fff; }
.iop-chip.warn .c { background: var(--iop-warn-bg); color: var(--iop-warn-fg); }
.iop-chip.warn.on .c { background: rgba(255,255,255,.25); color: #fff; }
.iop-tb-divider { width: 1px; height: 20px; background: var(--s200, #E7E5E4); }
.iop-search-mini {
  position: relative; flex: 1; max-width: 280px; min-width: 160px;
}
.iop-search-mini input {
  width: 100%; padding: 6px 12px 6px 12px;
  background: var(--s50, #FAFAF9); border: 1px solid var(--s100, #F5F5F4);
  border-radius: 8px; font-size: 12px; font-family: inherit;
}
.iop-search-mini input:focus {
  outline: none; background: #fff;
  border-color: var(--ink, #0A0A0A);
}

/* ─── FSO Section cards ─────────────────────────────────────────────── */
.iop-section {
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-rest); margin-bottom: 14px;
}
.iop-section-h {
  padding: 11px 18px; border-bottom: 1px solid var(--s100, #F5F5F4);
  display: flex; align-items: center; gap: 10px;
  justify-content: space-between;
}
.iop-section-h.awaiting {
  background: linear-gradient(90deg, var(--iop-due-bg) 0%, rgba(254,226,226,.4) 100%);
  border-bottom-color: rgba(220,38,38,.15);
}
.iop-section-h.inprogress {
  background: linear-gradient(90deg, var(--iop-warn-bg) 0%, rgba(254,243,199,.4) 100%);
  border-bottom-color: rgba(217,119,6,.15);
}
.iop-section-h.signed {
  background: linear-gradient(90deg, var(--iop-ok-bg) 0%, rgba(220,252,231,.4) 100%);
  border-bottom-color: rgba(21,128,61,.15);
}
.iop-section-h-l { display: flex; align-items: center; gap: 10px; }
.iop-section-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
}
.iop-section-icon.urgent { background: var(--iop-due-fg); }
.iop-section-icon.warn   { background: var(--iop-warn-fg); }
.iop-section-icon.ok     { background: var(--iop-ok-fg); }
.iop-section-icon svg { width: 14px; height: 14px; }
.iop-section-title {
  font-size: 13px; font-weight: 800; color: var(--ink, #0A0A0A);
  letter-spacing: -0.01em;
}
.iop-section-title .c {
  font-weight: 800; font-size: 11px; padding: 1px 7px;
  border-radius: 5px; margin-left: 6px; letter-spacing: 0.02em;
}
.iop-section-h.awaiting   .iop-section-title .c { background: var(--iop-due-fg); color: #fff; }
.iop-section-h.inprogress .iop-section-title .c { background: var(--iop-warn-fg); color: #fff; }
.iop-section-h.signed     .iop-section-title .c { background: var(--iop-ok-fg); color: #fff; }
.iop-section-sub {
  font-size: 11px; color: var(--s500, #78716C); font-weight: 700; margin-top: 2px;
}

/* ─── FSO table ─────────────────────────────────────────────────────── */
.iop-fso-table { width: 100%; border-collapse: collapse; }
.iop-fso-table th {
  background: var(--s50, #FAFAF9); padding: 9px 14px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--s500, #78716C);
  text-align: left; border-bottom: 1px solid var(--s200, #E7E5E4);
}
.iop-fso-table th.r { text-align: right; }
.iop-fso-table th.c { text-align: center; }
.iop-fso-table td {
  padding: 10px 14px; font-size: 12.5px;
  border-bottom: 1px solid var(--s100, #F5F5F4); vertical-align: middle;
}
.iop-fso-table td.r {
  text-align: right; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--ink, #0A0A0A);
}
.iop-fso-table td.c { text-align: center; }
.iop-fso-table tr:last-child td { border-bottom: none; }

.fso-row { transition: background 180ms cubic-bezier(.4,0,.2,1); position: relative; }
.fso-row:hover { background: var(--s50, #FAFAF9); }
.fso-row.pulse-urgent {
  background: linear-gradient(90deg, rgba(220,38,38,.06) 0%, transparent 70%);
  animation: iop-pulse-urgent-red 1.8s ease-in-out infinite;
}
.fso-row.pulse-warn {
  background: linear-gradient(90deg, rgba(217,119,6,.06) 0%, transparent 70%);
  animation: iop-pulse-warn-yellow 2s ease-in-out infinite;
}

.iop-client-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.iop-client-av {
  width: 30px; height: 30px; border-radius: 8px; color: #fff;
  font-size: 10.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.02em; flex-shrink: 0;
}
.iop-client-av.c1 { background: linear-gradient(135deg, #7C3AED, #A855F7); }
.iop-client-av.c2 { background: linear-gradient(135deg, var(--iop-info-fg), #3B82F6); }
.iop-client-av.c3 { background: linear-gradient(135deg, var(--iop-ok-fg), #16A34A); }
.iop-client-av.c4 { background: linear-gradient(135deg, #D97706, #F59E0B); }
.iop-client-av.c5 { background: linear-gradient(135deg, var(--red, #a16207), var(--red-dark, #854d0e)); }
.iop-client-mid { display: flex; flex-direction: column; min-width: 0; }
.iop-client-name {
  font-size: 12.5px; font-weight: 700; color: var(--ink, #0A0A0A);
  letter-spacing: -0.005em; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.iop-client-loc {
  font-size: 10.5px; color: var(--s500, #78716C);
  font-weight: 600; margin-top: 1px;
  display: flex; align-items: center; gap: 4px;
}
.iop-branch-pill {
  padding: 1px 5px; background: var(--s100, #F5F5F4);
  color: var(--s700, #44403C); border-radius: 3px;
  font-weight: 800; letter-spacing: 0.02em; font-size: 9.5px;
}

.iop-job-num {
  color: var(--iop-info-fg); font-weight: 800;
  cursor: pointer; font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.iop-job-num:hover { text-decoration: underline; }

.iop-pay-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 5px;
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.iop-pay-pill.cod      { background: var(--iop-info-bg); color: var(--iop-info-fg); }
.iop-pay-pill.paid     { background: var(--iop-ok-bg); color: var(--iop-ok-fg); }
.iop-pay-pill.deposit  { background: var(--iop-purple-bg); color: var(--iop-purple); }

.iop-age-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.iop-age-tag .age-pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.iop-age-tag.urgent { color: var(--iop-due-fg); }
.iop-age-tag.urgent .age-pulse-dot { background: var(--iop-due-fg); animation: iop-pulse-dot-red 1.4s ease-in-out infinite; }
.iop-age-tag.warn { color: var(--iop-warn-fg); }
.iop-age-tag.warn .age-pulse-dot { background: var(--iop-warn-fg); animation: iop-pulse-dot-yellow 1.6s ease-in-out infinite; }
.iop-age-tag.ok { color: var(--iop-ok-fg); }
.iop-age-tag.ok .age-pulse-dot { background: var(--iop-ok-fg); }

.iop-frames-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: 5px; font-size: 11px;
  font-weight: 800; background: var(--s100, #F5F5F4);
  color: var(--s700, #44403C);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em; min-width: 30px;
}

.iop-status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 5px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.iop-status-pill .dot { width: 5px; height: 5px; border-radius: 50%; }
.iop-status-pill.cm-awaiting {
  background: var(--iop-warn-bg); color: var(--iop-warn-deep);
  border: 1px solid rgba(217,119,6,.18);
}
.iop-status-pill.cm-awaiting .dot {
  background: var(--iop-warn-fg);
  animation: iop-pulse-dot-yellow 1.6s ease-in-out infinite;
}
.iop-status-pill.check-measure { background: var(--iop-info-bg); color: var(--iop-info-fg); }
.iop-status-pill.check-measure .dot { background: var(--iop-info-fg); }
.iop-status-pill.standard, .iop-status-pill.complete { background: var(--iop-ok-bg); color: var(--iop-ok-fg); }
.iop-status-pill.standard .dot, .iop-status-pill.complete .dot { background: var(--iop-ok-fg); }

.iop-row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.iop-cad-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; font-size: 11px; font-weight: 700;
  color: var(--s700, #44403C); background: #fff;
  border: 1px solid var(--s200, #E7E5E4); border-radius: 7px;
  cursor: pointer; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-cad-btn:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); }
.iop-cad-btn svg { width: 11px; height: 11px; }
.iop-open-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; font-size: 11px; font-weight: 800;
  color: var(--fos-on-plate); background: var(--fos-plate);
  border: 1px solid var(--fos-plate); border-radius: 7px;
  cursor: pointer; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-open-btn:hover { background: var(--fos-plate-hover); color: var(--fos-on-plate); transform: translateY(-1px); }
.iop-open-btn svg { width: 11px; height: 11px; transition: transform 180ms; }
.iop-open-btn:hover svg { transform: translateX(2px); }

/* ─── Install Schedule: crew strip ──────────────────────────────────── */
.iop-crew-strip {
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 12px; padding: 10px 14px;
  margin-bottom: 14px; box-shadow: var(--shadow-rest);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.iop-crew-label {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--s500, #78716C); flex-shrink: 0;
}
.iop-crew-list { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.iop-crew-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--s50, #FAFAF9);
  border: 1px solid var(--s200, #E7E5E4); border-radius: 10px;
  cursor: pointer; min-width: 180px; position: relative;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-crew-chip:hover { border-color: var(--ink, #0A0A0A); background: #fff; }
.iop-crew-av {
  width: 30px; height: 30px; border-radius: 8px; color: #fff;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.02em; flex-shrink: 0; position: relative;
}
.iop-crew-av.c1 { background: linear-gradient(135deg, var(--red, #a16207), var(--red-dark, #854d0e)); }
.iop-crew-av.c2 { background: linear-gradient(135deg, var(--iop-info-fg), var(--iop-info-light)); }
.iop-crew-av.c3 { background: linear-gradient(135deg, var(--iop-ok-fg), var(--iop-ok-light)); }
.iop-crew-av.c4 { background: linear-gradient(135deg, var(--iop-purple), var(--iop-purple-light)); }
.iop-crew-av.c5 { background: linear-gradient(135deg, var(--iop-warn-fg), var(--iop-warn-light)); }
.iop-crew-av .status-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff;
}
.iop-crew-av .status-dot.active { background: var(--iop-ok-fg); }
.iop-crew-av .status-dot.leave  { background: var(--s400, #A8A29E); }
.iop-crew-av .status-dot.over,
.iop-crew-av .status-dot.sick {
  background: var(--iop-due-fg);
  animation: iop-pulse-dot-red 1.4s ease-in-out infinite;
}
.iop-crew-mid { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.iop-crew-name {
  font-size: 12.5px; font-weight: 800; color: var(--ink, #0A0A0A);
  letter-spacing: -0.005em; line-height: 1.2;
}
.iop-crew-stats {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--s500, #78716C);
  font-weight: 700; margin-top: 2px;
}
.iop-crew-stats b { color: var(--ink, #0A0A0A); font-weight: 800; font-variant-numeric: tabular-nums; }
.iop-crew-cap-bar {
  flex: 1; min-width: 60px; max-width: 80px;
  height: 5px; background: var(--s200, #E7E5E4);
  border-radius: 3px; overflow: hidden; margin-left: 8px;
}
.iop-crew-cap-fill { height: 100%; border-radius: 3px; transition: width 600ms cubic-bezier(.4,0,.2,1); }
.iop-crew-chip.empty .iop-crew-cap-fill { background: var(--s300, #D6D3D1); }
.iop-crew-chip.under .iop-crew-cap-fill { background: var(--iop-info-light); }
.iop-crew-chip.good  .iop-crew-cap-fill { background: var(--iop-ok-fg); }
.iop-crew-chip.high  .iop-crew-cap-fill { background: var(--iop-warn-fg); }
.iop-crew-chip.over  .iop-crew-cap-fill { background: var(--iop-due-fg); }
.iop-crew-chip.over {
  border-color: rgba(220,38,38,.3);
  animation: iop-pulse-risk-red 2s ease-in-out infinite;
}
.iop-crew-add {
  padding: 8px 14px; background: #fff;
  border: 1px dashed var(--s300, #D6D3D1); border-radius: 10px;
  font-size: 12px; font-weight: 700; color: var(--s500, #78716C);
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit; transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-crew-add:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); background: var(--s50, #FAFAF9); }
.iop-crew-manage {
  padding: 8px 12px; background: var(--ink, #0A0A0A); color: #fff;
  border-radius: 9px; font-size: 11.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; font-family: inherit; border: none;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-crew-manage:hover { background: var(--s900, #1C1917); }

/* ─── Install Schedule: nav row (view toggle + period + day tabs) ──── */
.iop-nav-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 12px; padding: 8px 12px;
  box-shadow: var(--shadow-rest);
}
.iop-view-toggle {
  display: inline-flex; background: var(--s50, #FAFAF9);
  border: 1px solid var(--s200, #E7E5E4); border-radius: 9px;
  padding: 3px; gap: 2px;
}
.iop-view-tab {
  padding: 6px 12px; font-size: 11.5px; font-weight: 700;
  color: var(--s500, #78716C); border-radius: 6px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  border: none; background: none; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-view-tab:hover { color: var(--ink, #0A0A0A); }
.iop-view-tab.on { background: var(--ink, #0A0A0A); color: #fff; box-shadow: 0 1px 2px rgba(10,10,10,.15); }
.iop-nav-divider { width: 1px; height: 24px; background: var(--s200, #E7E5E4); }
.iop-period-nav { display: inline-flex; align-items: center; gap: 4px; }
/* A-668 — Today / This Week / Next Week plus the date range "24 Aug — 30 Aug" is
 * 323px of inline-flex with no wrap, and at 344px the page has 320. Four pixels,
 * and the whole page scrolled sideways for them. The date range wraps to its own
 * line below the buttons; the buttons are a choice and belong together. */
html[data-vp="xs"] .iop-period-nav,
html[data-vp="sm"] .iop-period-nav { flex-wrap: wrap; row-gap: 6px; max-width: 100%; }
html[data-vp="xs"] .iop-period-label,
html[data-vp="sm"] .iop-period-label { flex: 1 1 100%; order: 2; }
.iop-period-btn {
  padding: 6px 12px; font-size: 11.5px; font-weight: 700;
  color: var(--s700, #44403C); background: var(--s50, #FAFAF9);
  border: 1px solid var(--s200, #E7E5E4); border-radius: 8px;
  cursor: pointer; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-period-btn:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); }
.iop-period-btn.on { background: var(--fos-plate); color: var(--fos-on-plate); border-color: var(--fos-plate); box-shadow: 0 1px 2px rgba(250,204,21,.2); }
.iop-period-arrow {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--s200, #E7E5E4); background: #fff;
  color: var(--s500, #78716C);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-period-arrow:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); }
.iop-period-label {
  font-size: 13px; font-weight: 800; color: var(--ink, #0A0A0A);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  padding: 0 8px;
}
.iop-day-tabs {
  display: inline-flex; gap: 4px; flex: 1; justify-content: flex-end;
}
.iop-day-tab {
  padding: 6px 10px; font-size: 11px; font-weight: 700;
  color: var(--s500, #78716C); border-radius: 7px;
  cursor: pointer; display: inline-flex; flex-direction: column;
  align-items: center; gap: 1px;
  background: var(--s50, #FAFAF9); border: 1px solid transparent;
  min-width: 42px; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-day-tab:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); }
.iop-day-tab .dow {
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
}
.iop-day-tab .dn {
  font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.iop-day-tab.on { background: var(--ink, #0A0A0A); color: #fff; border-color: var(--ink, #0A0A0A); }
.iop-day-tab.on .dow { color: rgba(255,255,255,.65); }
.iop-day-tab.today { position: relative; }
.iop-day-tab.today::after {
  content: ''; position: absolute; bottom: 3px;
  left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--red, #a16207);
}
.iop-day-tab.today.on::after { background: #fff; }

/* ─── Install Schedule: grid ─────────────────────────────────────────── */
/* ── A-713 · the day header must survive scrolling ──────────────────────────
 *
 * Phoenix, 2026-09-02, on a 52-second recording of this board: "The
 * installation schedule is still very jittery. Scrolling weird, first initial
 * load is not working, it is really bad." Measured on the offline harness at
 * 1440x900, scrolling the window from 0 to its maximum:
 *
 *     window y     0    400    900   1400   1698(max)
 *     header top 770    370   -130   -630   -928
 *     visible    YES    YES     no     no     no
 *
 * The board sits ~770px down the page (page hero, day tabs, filters, legend
 * above it), so you MUST scroll to work it — and the moment you do, the
 * day-column header is gone and never comes back, because the window is
 * already at its maximum. On a board whose entire job is "which install is on
 * which DAY", the user is then reading a grid of cards with no idea what any
 * column means. That is the video: cards, no header, and scrolling that
 * appears to do nothing because it is pinned at the bottom.
 *
 * Two things were stopping a sticky header, and both are fixed here:
 *
 *   1. `overflow: hidden` on this wrap. It was here only to clip children to
 *      the 14px radius, but `overflow` other than `visible` creates a
 *      scrolling box, and a sticky child is offset relative to its NEAREST
 *      scrolling box — so the header stuck to the BOARD, which then scrolled
 *      away with the page. The children that need clipping
 *      (.iop-grid-h-days / .iop-grid-days-col) already clip themselves with
 *      overflow-x, and the corners are carried on the header and body below.
 *   2. Nothing bounded the board's height, so a long board (Graham's has 15+
 *      installer rows at 74px each) made the wrap taller than the viewport and
 *      the header rode out of the top of its own containing block. Bounding
 *      .iop-grid-body means the ROWS scroll under a header that stays put —
 *      the standard split-header grid, and the reason the installer-name
 *      column needs no sync: both columns live inside .iop-grid-body, so one
 *      scroller moves them together.
 *
 * Fenced on min-height so a short viewport is untouched: on an 882x344 cover
 * screen an inner scroller of its own is worse than letting the page scroll,
 * and A-668's target set includes exactly that shape.
 */
.iop-grid-wrap {
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px; overflow: visible;
  margin-bottom: 14px; box-shadow: var(--shadow-rest);
}
.iop-grid-h {
  display: flex; border-bottom: 1px solid var(--s200, #E7E5E4);
  background: var(--s50, #FAFAF9);
  position: sticky; top: var(--sp-chrome-h, 96px); z-index: 12;
  border-radius: 14px 14px 0 0;
}
@media (min-height: 640px) {
  .iop-grid-body {
    max-height: calc(100vh - var(--sp-chrome-h, 96px) - 150px);
    min-height: 340px;
    overflow-y: auto;
    border-radius: 0 0 14px 14px;
  }
}
.iop-grid-h-installer {
  width: 170px; flex-shrink: 0; padding: 9px 14px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--s500, #78716C);
  display: flex; align-items: center;
  border-right: 1px solid var(--s200, #E7E5E4);
}
.iop-grid-h-days { flex: 1; display: flex; overflow-x: auto; min-width: 0; }
.iop-grid-h-day {
  flex: 1; min-width: 380px; display: flex; flex-direction: column;
  border-right: 1px solid var(--s100, #F5F5F4);
}
.iop-grid-h-day:last-child { border-right: none; }
.iop-grid-h-day-title {
  padding: 7px 14px; font-size: 11.5px; font-weight: 800;
  color: var(--ink, #0A0A0A); letter-spacing: -0.005em;
  background: var(--s100, #F5F5F4);
  border-bottom: 1px solid var(--s200, #E7E5E4);
  display: flex; align-items: center; justify-content: space-between;
}
.iop-grid-h-day-title.today {
  background: linear-gradient(90deg, rgba(250,204,21,.08), rgba(250,204,21,.02));
  color: var(--red, #a16207);
}
.iop-grid-h-day-title .day-stat {
  font-size: 9.5px; font-weight: 700; color: var(--s500, #78716C);
  letter-spacing: -0.005em;
}
.iop-grid-h-day-title.today .day-stat { color: var(--red, #a16207); }
.iop-grid-h-hours { display: flex; padding: 0; }
.iop-grid-h-hour {
  flex: 1; text-align: center; padding: 5px 0;
  font-size: 9.5px; font-weight: 700;
  color: var(--s400, #A8A29E); letter-spacing: 0.02em;
  border-right: 1px solid var(--s100, #F5F5F4);
}
.iop-grid-h-hour:last-child { border-right: none; }

/* A-731 — THE NAME MUST SIT ON ITS OWN ROW.
 *
 * Phoenix, on a recording: "The installation schedule does not line up with
 * each persons name. This is broken."
 *
 * Both columns iterate the SAME row model and stamp the SAME per-row height, so
 * the markup cannot disagree — and it doesn't. The shear was pure flexbox:
 *
 *   1. A-713 gave this body a `max-height` + `overflow-y: auto` (above) to hold
 *      the day header still. `align-items` therefore STRETCHED both columns to
 *      the visible height instead of letting them be as tall as their rows.
 *   2. `.iop-grid-installer-col` is a COLUMN flex, so its rows became flex items
 *      in a too-short container with the default `flex-shrink: 1`. Each one
 *      collapsed to its own min-content height — 102px of booked lanes down to
 *      81px of avatar-and-name — and because min-content differs per row the
 *      loss was UNEVEN and accumulated: measured 201px of drift by installer 16,
 *      i.e. the name beside a bar belonged to somebody two rows away.
 *   3. Meanwhile the day columns kept full height, because `.iop-grid-days-col`
 *      has `overflow-x: auto` and the spec forces `overflow-y: visible` to
 *      `auto` alongside it — making it a SECOND vertical scroller that the
 *      body's scrollbar does not move. So even matched rows sheared on scroll.
 *
 * `align-items: flex-start` is what fixes (1) and (3): each column is as tall as
 * its own rows, so the days column has no vertical overflow of its own and the
 * body is the ONE vertical scroller, moving both columns together. The
 * `flex-shrink: 0` on the row rules below fixes (2) and states the invariant
 * outright — a row's height comes from the row model, never from how much space
 * happens to be left over. Do not remove either one, and do not bound the height
 * of a column without re-checking `a731-board-row-alignment.mjs`: this whole
 * class of fault is invisible in the DOM and only a real engine measures it.
 */
.iop-grid-body { display: flex; align-items: flex-start; min-height: 240px; }
.iop-grid-installer-col {
  width: 170px; flex-shrink: 0; background: var(--s50, #FAFAF9);
  border-right: 1px solid var(--s200, #E7E5E4);
  display: flex; flex-direction: column;
}
.iop-grid-installer-row {
  padding: 14px; border-bottom: 1px solid var(--s100, #F5F5F4);
  display: flex; align-items: center; gap: 9px; height: 74px;
  flex-shrink: 0;   /* A-731 — the row model owns this height (see .iop-grid-body) */
}
.iop-grid-installer-row:last-child { border-bottom: none; }
.iop-installer-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.iop-installer-name {
  font-size: 12.5px; font-weight: 800; color: var(--ink, #0A0A0A);
  letter-spacing: -0.005em; line-height: 1.2;
}
.iop-installer-stat {
  font-size: 10px; color: var(--s500, #78716C);
  font-weight: 700; margin-top: 2px;
}
.iop-installer-stat b { color: var(--ink, #0A0A0A); font-weight: 800; font-variant-numeric: tabular-nums; }
.iop-installer-cap {
  margin-top: 5px; height: 4px; background: var(--s200, #E7E5E4);
  border-radius: 3px; overflow: hidden; width: 100%; max-width: 100px;
}
.iop-installer-cap-fill { height: 100%; border-radius: 3px; transition: width 600ms cubic-bezier(.4,0,.2,1); }
.iop-installer-cap-fill.empty { width: 0; }
.iop-installer-cap-fill.under { background: var(--iop-info-light); }
.iop-installer-cap-fill.good  { background: var(--iop-ok-fg); }
.iop-installer-cap-fill.high  { background: var(--iop-warn-fg); }
.iop-installer-cap-fill.over  { background: var(--iop-due-fg); }

.iop-grid-days-col { flex: 1; overflow-x: auto; min-width: 0; }
.iop-grid-day {
  flex: 1; min-width: 380px; border-right: 1px solid var(--s100, #F5F5F4);
  display: flex; flex-direction: column; position: relative;
}
.iop-grid-day:last-child { border-right: none; }
.iop-grid-day.today-col {
  background: linear-gradient(180deg, rgba(250,204,21,.02) 0%, transparent 30%);
}
.iop-grid-cell-row {
  display: flex; height: 74px;
  border-bottom: 1px solid var(--s100, #F5F5F4);
  position: relative;
  flex-shrink: 0;   /* A-731 — same invariant on the day side of the same row */
}
.iop-grid-cell-row:last-child { border-bottom: none; }
.iop-grid-cell {
  flex: 1; border-right: 1px solid var(--s100, #F5F5F4);
  position: relative; cursor: pointer;
  transition: background 180ms cubic-bezier(.4,0,.2,1);
}
.iop-grid-cell:last-child { border-right: none; }
.iop-grid-cell:hover { background: rgba(250,204,21,.04); }
.iop-grid-cell.empty::before {
  content: '+'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px; color: var(--s300, #D6D3D1);
  font-weight: 300; opacity: 0;
  transition: opacity 180ms cubic-bezier(.4,0,.2,1);
}
.iop-grid-cell.empty:hover::before { opacity: 1; }
.iop-now-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--red, #a16207);
  box-shadow: 0 0 4px rgba(161,98,7,.4);
  z-index: 5; pointer-events: none;
}
.iop-now-line::before {
  content: ''; position: absolute; top: -3px; left: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red, #a16207);
  box-shadow: 0 0 0 2px #fff;
}

/* ─── Install Schedule: job cards in grid ───────────────────────────── */
.iop-job-card {
  position: absolute; top: 6px; bottom: 6px;
  border-radius: 7px; padding: 6px 9px; color: #fff;
  cursor: grab; transition: all 180ms cubic-bezier(.4,0,.2,1);
  overflow: hidden; display: flex; flex-direction: column; gap: 2px;
  font-size: 10.5px; box-shadow: 0 2px 6px -2px rgba(0,0,0,.2);
  z-index: 3;
}
.iop-job-card:hover { transform: translateY(-1px); box-shadow: 0 6px 12px -2px rgba(0,0,0,.25); z-index: 4; }
.iop-job-card.green  { background: linear-gradient(135deg, var(--iop-ok-fg), var(--iop-ok-deep)); }
.iop-job-card.blue   { background: linear-gradient(135deg, var(--iop-info-fg), #1E40AF); }
.iop-job-card.purple { background: linear-gradient(135deg, var(--iop-purple), #6D28D9); }
.iop-job-card.amber  { background: linear-gradient(135deg, var(--iop-warn-fg), var(--iop-warn-deep)); }
/* A-514 — client-picked date awaiting office approval: unmistakably YELLOW
   (true yellow, distinct from the darker .amber factory-warn), dark text for
   contrast, dashed border + ⏳ marker. Approve/reject under Client Booking. */
.iop-job-card.client-pending { background: linear-gradient(135deg, #facc15, #ca8a04); color: #422006; border: 1.5px dashed #a16207; }
.iop-job-card.client-pending .jc-bg { display: none; }            /* the pick isn't approved — don't paint it as committed crew time */
.iop-job-card.client-pending::after {
  content: '⏳'; position: absolute; top: 4px; right: 6px; font-size: 11px;
}
.iop-job-card.at-risk { animation: iop-pulse-risk-red 1.8s ease-in-out infinite; }
.iop-job-card.at-risk::before {
  content: ''; position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 2px rgba(220,38,38,.6);
}
.iop-job-card .jc-job   { font-size: 11.5px; font-weight: 900; letter-spacing: -0.005em; line-height: 1; }
.iop-job-card .jc-client { font-size: 10px; font-weight: 700; line-height: 1.2; opacity: .95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-job-card .jc-loc   { font-size: 9px; font-weight: 600; line-height: 1.2; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-job-card .jc-foot  { font-size: 9.5px; font-weight: 700; margin-top: auto; display: flex; align-items: center; gap: 6px; opacity: .95; }
.iop-job-card .jc-foot .sep { opacity: .5; }

/* ─── Install Schedule: Smart Recommendations panel ─────────────────── */
.iop-recs-panel {
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px; overflow: hidden;
  margin-bottom: 14px; box-shadow: var(--shadow-rest);
}
.iop-recs-h {
  padding: 11px 18px;
  background: linear-gradient(90deg, var(--pale-red, #fefce8) 0%, rgba(254,252,232,.4) 100%);
  border-bottom: 1px solid var(--s200, #E7E5E4);
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.iop-recs-h-l { display: flex; align-items: center; gap: 10px; }
.iop-recs-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--fos-plate), var(--fos-plate-hover));
  color: var(--fos-on-plate);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.iop-recs-icon svg { width: 16px; height: 16px; }
.iop-recs-title {
  font-size: 14px; font-weight: 900; color: var(--ink, #0A0A0A);
  letter-spacing: -0.015em; line-height: 1.1;
}
.iop-recs-sub {
  font-size: 10.5px; color: var(--s500, #78716C);
  font-weight: 700; margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.iop-recs-sub .source {
  padding: 1px 6px; background: var(--ink, #0A0A0A); color: #fff;
  border-radius: 4px; font-size: 8.5px;
  letter-spacing: 0.08em; font-weight: 800;
}
.iop-recs-count {
  padding: 3px 8px; background: var(--fos-plate); color: var(--fos-on-plate);
  border-radius: 6px; font-size: 10.5px;
  font-weight: 800; letter-spacing: 0.02em;
}
.iop-recs-body { padding: 8px; }
.iop-rec-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--s200, #E7E5E4);
  background: var(--s50, #FAFAF9); margin-bottom: 6px;
  cursor: pointer;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-rec-item:last-child { margin-bottom: 0; }
.iop-rec-item:hover {
  border-color: var(--ink, #0A0A0A); background: #fff;
  transform: translateY(-1px); box-shadow: var(--shadow-rest);
}
.iop-rec-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
}
.iop-rec-item.priority-high .iop-rec-icon { background: linear-gradient(135deg, var(--iop-due-fg), var(--iop-due-deep)); }
.iop-rec-item.priority-med  .iop-rec-icon { background: linear-gradient(135deg, var(--iop-warn-fg), var(--iop-warn-deep)); }
.iop-rec-item.priority-low  .iop-rec-icon { background: linear-gradient(135deg, var(--iop-info-fg), #1E40AF); }
.iop-rec-icon svg { width: 14px; height: 14px; }
.iop-rec-mid { flex: 1; min-width: 0; }
.iop-rec-title {
  font-size: 13px; font-weight: 800; color: var(--ink, #0A0A0A);
  letter-spacing: -0.01em; line-height: 1.2;
  display: flex; align-items: center; gap: 6px;
}
.iop-rec-title .delta {
  font-size: 10.5px; font-weight: 800;
  padding: 1px 6px; border-radius: 4px;
  letter-spacing: 0.02em;
}
.iop-rec-item.priority-high .delta { background: var(--iop-due-bg); color: var(--iop-due-fg); }
.iop-rec-item.priority-med  .delta { background: var(--iop-warn-bg); color: var(--iop-warn-fg); }
.iop-rec-item.priority-low  .delta { background: var(--iop-info-bg); color: var(--iop-info-fg); }
.iop-rec-sub {
  font-size: 11px; color: var(--s500, #78716C);
  font-weight: 600; margin-top: 3px;
  letter-spacing: -0.005em; line-height: 1.3;
}
.iop-rec-sub b { color: var(--ink, #0A0A0A); font-weight: 800; }
.iop-rec-action {
  padding: 6px 11px; background: #fff;
  border: 1px solid var(--s200, #E7E5E4); border-radius: 7px;
  font-size: 11px; font-weight: 800; color: var(--ink, #0A0A0A);
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  flex-shrink: 0; font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.iop-rec-action:hover { border-color: var(--ink, #0A0A0A); background: var(--ink, #0A0A0A); color: #fff; }

/* ─── Install Schedule: Unscheduled strip ────────────────────────── */
.iop-unsched {
  background: #fff; border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-rest);
}
.iop-unsched-h {
  padding: 11px 18px;
  border-bottom: 1px solid var(--s100, #F5F5F4);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--s50, #FAFAF9);
}
.iop-unsched-h-l { display: flex; align-items: center; gap: 10px; }
.iop-unsched-h-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--s200, #E7E5E4); color: var(--s600, #57534E);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.iop-unsched-h-icon svg { width: 14px; height: 14px; }
.iop-unsched-h-title {
  font-size: 13px; font-weight: 800; color: var(--ink, #0A0A0A);
  letter-spacing: -0.01em;
}
.iop-unsched-h-title .c {
  font-weight: 800; font-size: 11px;
  padding: 1px 7px; border-radius: 5px;
  background: var(--iop-ok-bg); color: var(--iop-ok-fg);
  margin-left: 6px; letter-spacing: 0.02em;
}
.iop-unsched-h-sub {
  font-size: 10.5px; color: var(--s500, #78716C);
  font-weight: 700; margin-top: 2px;
}
.iop-unsched-body {
  padding: 14px; display: flex; align-items: center; justify-content: center;
  min-height: 80px; color: var(--s500, #78716C);
  font-size: 12px; font-weight: 700; gap: 8px;
}
.iop-unsched-body .check-ico { width: 18px; height: 18px; color: var(--iop-ok-fg); }
.iop-unsched-body b { color: var(--iop-ok-fg); font-weight: 800; }

/* ─── Install Schedule: week-view stacked day cell ─────────────────────── */
.iop-week-cell { height: 100%; padding: 5px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; position: relative; }
.iop-week-job {
  border-radius: 6px; padding: 4px 7px; color: #fff; cursor: pointer; flex: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform 150ms cubic-bezier(.4,0,.2,1);
}
.iop-week-job:hover { transform: translateY(-1px); }
.iop-week-job.green  { background: linear-gradient(135deg, var(--iop-ok-fg,#15803D), var(--iop-ok-deep,#166534)); }
.iop-week-job.blue   { background: linear-gradient(135deg, var(--iop-info-fg,#2563EB), #1E40AF); }
.iop-week-job.purple { background: linear-gradient(135deg, var(--iop-purple,#7C3AED), #6D28D9); }
.iop-week-job.amber  { background: linear-gradient(135deg, var(--iop-warn-fg,#D97706), var(--iop-warn-deep,#B45309)); }
.iop-week-job.client-pending { background: linear-gradient(135deg, #facc15, #ca8a04); color: #422006; border: 1.5px dashed #a16207; }  /* A-514 client pick — pending approval */
.iop-week-job.at-risk { animation: iop-pulse-risk-red 1.8s ease-in-out infinite; background: linear-gradient(135deg,#DC2626,#991B1B); }
.iop-week-job .wj-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10.5px; }
.iop-week-job .wj-top b { font-weight: 900; }
.iop-week-job .wj-top span { font-size: 9px; opacity: .9; font-weight: 700; }
.iop-week-job .wj-client { font-size: 9.5px; font-weight: 600; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-week-add {
  margin-top: auto; align-self: stretch; border: 1px dashed var(--s300,#D6D3D1);
  background: transparent; color: var(--s400,#A8A29E); border-radius: 6px;
  font-size: 14px; font-weight: 400; line-height: 1; padding: 3px 0; cursor: pointer;
  opacity: 0; transition: opacity 160ms, border-color 160ms, color 160ms, background 160ms;
}
.iop-grid-cell-row:hover .iop-week-add { opacity: 1; }
.iop-week-add:hover { border-color: var(--red,#a16207); color: var(--red,#a16207); background: rgba(250,204,21,.04); }

/* ─── Install Schedule: "Book a slot" modal ────────────────────────────── */
.iop-sm-overlay {
  position: fixed; inset: 0; z-index: 9999; background: rgba(10,10,10,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px; animation: iop-sm-fade 160ms ease-out;
}
@keyframes iop-sm-fade { from { opacity: 0; } to { opacity: 1; } }
.iop-sm-panel {
  width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.4); animation: iop-sm-rise 220ms cubic-bezier(.16,1,.3,1);
}
@keyframes iop-sm-rise { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.iop-sm-head { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid var(--s100,#F5F5F4); }
.iop-sm-head-pulse { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--red,#a16207); animation: iop-sm-pulse 1.8s ease-in-out infinite; }
@keyframes iop-sm-pulse { 0% { box-shadow: 0 0 0 0 rgba(161,98,7,.5); } 70% { box-shadow: 0 0 0 8px rgba(161,98,7,0); } 100% { box-shadow: 0 0 0 0 rgba(161,98,7,0); } }
.iop-sm-head-txt { flex: 1; min-width: 0; }
.iop-sm-eyebrow { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--red,#a16207); }
.iop-sm-title { font-size: 19px; font-weight: 900; letter-spacing: -.01em; color: var(--ink,#0A0A0A); line-height: 1.1; margin-top: 2px; }
.iop-sm-ctx { font-size: 12px; font-weight: 700; color: var(--s500,#78716C); margin-top: 3px; }
.iop-sm-x { border: none; background: var(--s100,#F5F5F4); color: var(--s500,#78716C); width: 30px; height: 30px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; flex: none; transition: background 150ms, color 150ms; }
.iop-sm-x:hover { background: var(--s200,#E7E5E4); color: var(--ink,#0A0A0A); }
.iop-sm-tabs { display: flex; gap: 6px; padding: 12px 18px 0; }
.iop-sm-tab { border: none; background: transparent; padding: 7px 14px; border-radius: 8px 8px 0 0; font-size: 12.5px; font-weight: 800; color: var(--s500,#78716C); cursor: pointer; border-bottom: 2px solid transparent; }
.iop-sm-tab.on { color: var(--red,#a16207); border-bottom-color: var(--red,#a16207); background: rgba(250,204,21,.05); }
.iop-sm-search { display: flex; align-items: center; gap: 8px; margin: 12px 18px 4px; padding: 9px 12px; background: var(--s50,#FAFAF9); border: 1px solid var(--s200,#E7E5E4); border-radius: 10px; color: var(--s400,#A8A29E); }
.iop-sm-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 13px; font-weight: 600; color: var(--ink,#0A0A0A); }
.iop-sm-rows { flex: 1; overflow-y: auto; padding: 6px 12px 8px; min-height: 120px; }
.iop-sm-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; border-bottom: 1px solid var(--s100,#F5F5F4); transition: background 140ms; }
.iop-sm-row:hover { background: var(--s50,#FAFAF9); }
.iop-sm-row-main { flex: 1; min-width: 0; }
.iop-sm-row-num { font-size: 13px; font-weight: 900; color: var(--ink,#0A0A0A); display: flex; align-items: center; gap: 6px; }
.iop-sm-row-client { font-size: 12px; font-weight: 700; color: var(--s600,#57534E); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-sm-row-meta { font-size: 10.5px; font-weight: 600; color: var(--s400,#A8A29E); margin-top: 1px; }
.iop-sm-pill { font-size: 9px; font-weight: 800; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; letter-spacing: .03em; }
.iop-sm-pill.svc { background: rgba(124,58,237,.12); color: var(--iop-purple,#7C3AED); }
.iop-sm-book { flex: none; display: inline-flex; align-items: center; gap: 5px; border: none; background: var(--fos-plate); color: var(--fos-on-plate); cursor: pointer; padding: 7px 13px; border-radius: 8px; font-size: 12px; font-weight: 800; box-shadow: 0 2px 6px -1px rgba(250,204,21,.4); transition: transform 140ms, box-shadow 140ms; }
.iop-sm-book:hover { transform: translateY(-1px); box-shadow: 0 5px 12px -2px rgba(250,204,21,.5); }
.iop-sm-empty { padding: 36px 16px; text-align: center; color: var(--s400,#A8A29E); font-size: 12.5px; font-weight: 600; }
.iop-sm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--s100,#F5F5F4); background: var(--s50,#FAFAF9); }
.iop-sm-foot-hint { font-size: 11px; font-weight: 600; color: var(--s500,#78716C); }
.iop-sm-cancel { border: 1px solid var(--s200,#E7E5E4); background: #fff; color: var(--s600,#57534E); padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 800; cursor: pointer; }
.iop-sm-cancel:hover { background: var(--s100,#F5F5F4); }

/* ─── Book-a-slot modal: browse rows + two-step config ─────────────────── */
.iop-sm-row { cursor: pointer; }
.iop-sm-row-chev { color: var(--s300,#D6D3D1); flex: none; }
.iop-sm-row:hover .iop-sm-row-chev { color: var(--red,#a16207); }
.iop-sm-pill.booked { background: rgba(37,99,235,.12); color: var(--iop-info-fg,#2563EB); }
.iop-sm-cfg { flex: 1; overflow-y: auto; padding: 8px 18px 4px; }
.iop-sm-back { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; color: var(--s500,#78716C); font-size: 12px; font-weight: 800; cursor: pointer; padding: 4px 0 10px; }
.iop-sm-back:hover { color: var(--red,#a16207); }
.iop-sm-summary { background: var(--s50,#FAFAF9); border: 1px solid var(--s200,#E7E5E4); border-radius: 12px; padding: 10px 12px; }
.iop-sm-sum-row { display: flex; gap: 10px; padding: 4px 0; font-size: 12px; }
.iop-sm-sum-row span { width: 92px; flex: none; color: var(--s500,#78716C); font-weight: 700; }
.iop-sm-sum-row b { color: var(--ink,#0A0A0A); font-weight: 700; }
.iop-sm-ai { margin-top: 10px; }
.iop-sm-ai-btn { width: 100%; border: 1px dashed var(--red,#a16207); background: rgba(250,204,21,.04); color: var(--red,#a16207); border-radius: 10px; padding: 9px; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.iop-sm-ai-btn:hover { background: rgba(250,204,21,.08); }
.iop-sm-ai-loading { font-size: 12.5px; font-weight: 700; color: var(--red,#a16207); padding: 10px; }
.iop-sm-ai-txt { font-size: 12px; line-height: 1.5; color: var(--s700,#44403C); background: #fff; border: 1px solid var(--s200,#E7E5E4); border-radius: 10px; padding: 12px; max-height: 200px; overflow-y: auto; }
.iop-sm-field { margin-top: 14px; }
.iop-sm-flabel { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--s400,#A8A29E); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.iop-sm-count { font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--red,#a16207); }
.iop-sm-crew-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 6px; }
.iop-sm-crew { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--s200,#E7E5E4); border-radius: 9px; cursor: pointer; transition: border-color 140ms, background 140ms; }
.iop-sm-crew:hover { border-color: var(--s300,#D6D3D1); }
.iop-sm-crew.on { border-color: var(--red,#a16207); background: rgba(250,204,21,.04); }
.iop-sm-crew input { accent-color: var(--red,#a16207); width: 15px; height: 15px; flex: none; cursor: pointer; }
.iop-sm-crew-av { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 9.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.iop-sm-crew-name { font-size: 12px; font-weight: 700; color: var(--ink,#0A0A0A); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-sm-crew-name span { color: var(--s400,#A8A29E); font-weight: 600; }
.iop-sm-time-field { margin-top: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.iop-sm-time-field > div { flex: 1; min-width: 150px; }
.iop-sm-chips { display: flex; gap: 5px; margin-bottom: 6px; flex-wrap: wrap; }
.iop-sm-chip { border: 1px solid var(--s200,#E7E5E4); background: #fff; border-radius: 7px; padding: 4px 9px; font-size: 11.5px; font-weight: 700; color: var(--s600,#57534E); cursor: pointer; }
.iop-sm-chip.on, .iop-sm-chip:hover { border-color: var(--red,#a16207); color: var(--red,#a16207); background: rgba(250,204,21,.04); }
.iop-sm-cfg input[type="time"], .iop-sm-cfg input[type="number"] { width: 100%; padding: 8px 10px; border: 1px solid var(--s200,#E7E5E4); border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--ink,#0A0A0A); outline: none; }
.iop-sm-cfg input[type="time"]:focus, .iop-sm-cfg input[type="number"]:focus { border-color: var(--red,#a16207); }
.iop-sm-rec { font-size: 10.5px; font-weight: 700; color: var(--s400,#A8A29E); margin-top: 5px; }
.iop-sm-confirm { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--fos-plate); color: var(--fos-on-plate); cursor: pointer; padding: 9px 18px; border-radius: 9px; font-size: 13px; font-weight: 800; box-shadow: 0 3px 10px -2px rgba(250,204,21,.45); transition: transform 140ms, box-shadow 140ms; }
.iop-sm-confirm:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -2px rgba(250,204,21,.55); }

/* ─── Auto Schedule review modal ───────────────────────────────────────── */
.iop-auto-panel { max-width: 680px; }
.iop-auto-targets { padding: 12px 18px 4px; }
.iop-auto-tlabel { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--s400,#A8A29E); margin-bottom: 8px; }
.iop-auto-tlabel span { font-weight: 600; text-transform: none; letter-spacing: 0; }
.iop-auto-tgrid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 10px; }
.iop-auto-tcard { background: var(--s50,#FAFAF9); border: 1px solid var(--s200,#E7E5E4); border-radius: 10px; padding: 9px 11px; }
.iop-auto-tbranch { font-size: 12px; font-weight: 800; color: var(--ink,#0A0A0A); }
.iop-auto-tbar { height: 7px; border-radius: 4px; background: var(--s200,#E7E5E4); overflow: hidden; display: flex; margin: 6px 0; }
.iop-auto-tbar .seg { height: 100%; }
.iop-auto-tbar .seg.cur { background: var(--s400,#A8A29E); }
.iop-auto-tbar .seg.prop { background: var(--red,#a16207); }
.iop-auto-tnums { font-size: 10.5px; font-weight: 700; color: var(--s500,#78716C); }
.iop-auto-tnums b { color: var(--ink,#0A0A0A); }
.iop-auto-tadd { color: var(--red,#a16207); font-weight: 800; }
.iop-auto-rows { padding: 6px 12px 8px; }
.iop-auto-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 8px; border-bottom: 1px solid var(--s100,#F5F5F4); transition: opacity 140ms; }
.iop-auto-row.off { opacity: .45; }
.iop-auto-check { flex: none; padding-top: 2px; }
.iop-auto-check input { width: 16px; height: 16px; accent-color: var(--red,#a16207); cursor: pointer; }
.iop-auto-main { flex: 1; min-width: 0; }
.iop-auto-toprow { font-size: 13px; color: var(--ink,#0A0A0A); }
.iop-auto-toprow b { font-weight: 900; }
.iop-auto-client { font-weight: 700; }
.iop-auto-sub { color: var(--s400,#A8A29E); font-weight: 600; }
.iop-auto-when { font-size: 11.5px; font-weight: 700; color: var(--s600,#57534E); margin-top: 3px; }
.iop-auto-why { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.iop-auto-chip { font-size: 10px; font-weight: 700; color: var(--s600,#57534E); background: var(--s100,#F5F5F4); border-radius: 999px; padding: 2px 8px; }
.iop-auto-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.iop-auto-val { font-size: 13px; font-weight: 900; color: var(--ink,#0A0A0A); }
.iop-auto-call { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--s200,#E7E5E4); background: #fff; color: var(--ink,#0A0A0A); border-radius: 7px; padding: 5px 10px; font-size: 11px; font-weight: 800; cursor: pointer; }
.iop-auto-call:hover { border-color: var(--red,#a16207); color: var(--red,#a16207); background: rgba(250,204,21,.04); }

/* booking modal: installer vehicle chip + delivery line */
.iop-sm-crew-van { color: var(--iop-ok-fg,#15803D); font-weight: 700; }

/* GP-082 per-day crew picker - aligned grid (mirrors .iop-sm-crew-list) */
.iop-sm-dayrow-crew { display: grid; grid-template-columns: repeat(auto-fill,minmax(116px,1fr)); gap: 6px; margin-top: 8px; }
.iop-sm-daycrew { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--s200,#E7E5E4); border-radius: 8px; cursor: pointer; transition: border-color 140ms, background 140ms; }
.iop-sm-daycrew:hover { border-color: var(--s300,#D6D3D1); }
.iop-sm-daycrew.on { border-color: var(--red,#a16207); background: rgba(250,204,21,.04); }
.iop-sm-daycrew input { accent-color: var(--red,#a16207); width: 15px; height: 15px; flex: none; cursor: pointer; }
.iop-sm-daycrew span { font-size: 12px; font-weight: 700; color: var(--ink,#0A0A0A); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* GP-082 per-day day-block framing (secondary polish) */
.iop-sm-dayrow { border: 1px solid var(--s200,#E7E5E4); border-radius: 10px; padding: 10px; margin-top: 8px; }
.iop-sm-dayrow-hdr { font-size: 11px; font-weight: 800; color: var(--s500,#78716C); text-transform: uppercase; letter-spacing: .04em; }
.iop-sm-dayrow-times { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.iop-sm-halfday { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink,#0A0A0A); }
.iop-sm-daycount { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.iop-sm-delivery { margin-top: 12px; font-size: 11.5px; font-weight: 700; color: var(--s600,#57534E); background: var(--s50,#FAFAF9); border: 1px solid var(--s200,#E7E5E4); border-radius: 9px; padding: 8px 10px; }
.iop-sm-delivery-warn { color: #b91c1c; }

/* ─── Coloured time-breakdown bar on day cards + legend + roll-over ─────── */
.iop-job-card.seg { background: none !important; padding: 0; }
.iop-job-card .jc-bg { position: absolute; inset: 0; display: flex; border-radius: 7px; overflow: hidden; }
.iop-job-card .jc-bg span { height: 100%; transition: filter .15s; }
.iop-job-card .jc-bg span:hover { filter: brightness(1.12); }
.iop-job-card .jc-fg { position: relative; z-index: 1; height: 100%; padding: 6px 9px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.seg-deliver { background: #eab308; }   /* yellow — pickup / delivery */
.seg-install { background: #16a34a; }   /* green — install */
.seg-tip     { background: #dc2626; }   /* red — tip run */
.iop-job-card.overflows { outline: 1px dashed rgba(255,255,255,.75); outline-offset: -2px; }
/* Continuation block (2nd+ working day of a multi-day job) — dashed left edge. */
.iop-job-card.continues { border-left: 3px dashed rgba(255,255,255,.85); }
.jc-rollover { margin-left: auto; font-weight: 800; color: #fff; background: rgba(0,0,0,.28); border-radius: 4px; padding: 0 5px; font-size: 9px; }
.jc-cont { margin-left: 5px; font-weight: 800; color: #fff; background: rgba(0,0,0,.28); border-radius: 4px; padding: 0 5px; font-size: 8.5px; vertical-align: middle; }
/* Week-view continuation block + multi-day badge. */
.iop-week-job.continues { border-left: 3px dashed rgba(255,255,255,.85); opacity: .92; }
.iop-week-job .wj-day { font-weight: 900; background: rgba(0,0,0,.26); border-radius: 3px; padding: 0 4px; font-size: 8.5px; }
.iop-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--s100,#F5F5F4); font-size: 11px; font-weight: 700; color: var(--s600,#57534E); }
.iop-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.iop-legend-sw { width: 14px; height: 8px; border-radius: 3px; display: inline-block; }
.iop-legend-note { margin-left: auto; font-weight: 600; color: var(--s400,#A8A29E); }
.iop-sm-fit { margin-top: 12px; font-size: 12px; font-weight: 700; border-radius: 9px; padding: 9px 11px; }
.iop-sm-fit.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.iop-sm-fit.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* AI crew recommendation in the booking modal */
.iop-sm-aicrew { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iop-sm-aicrew-ok { font-size: 11.5px; font-weight: 700; color: var(--iop-purple,#7C3AED); flex: 1; min-width: 0; }
.iop-sm-aicrew-load { font-size: 11.5px; font-weight: 700; color: var(--red,#a16207); flex: 1; }
.iop-sm-aicrew-warn { font-size: 11.5px; font-weight: 700; color: #b45309; flex: 1; }
.iop-sm-aicrew-hint { font-size: 11px; font-weight: 600; color: var(--s400,#A8A29E); flex: 1; }
.iop-sm-aicrew-btn { flex: none; border: 1px solid var(--iop-purple,#7C3AED); background: rgba(124,58,237,.06); color: var(--iop-purple,#7C3AED); border-radius: 7px; padding: 5px 10px; font-size: 11px; font-weight: 800; cursor: pointer; }
.iop-sm-aicrew-btn:hover { background: rgba(124,58,237,.12); }
.iop-sm-aiauto { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--iop-purple,#7C3AED); background: rgba(124,58,237,.06); color: var(--iop-purple,#7C3AED); padding: 9px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.iop-sm-aiauto:hover { background: rgba(124,58,237,.12); }

/* ── Installer Teams + per-installer filter (2026-06-11) ─────────────────────
   Team header rows in the schedule grid. .iop-grid-team-row (installer column)
   and .iop-grid-team-spacer (every day column) MUST keep equal heights so the
   two columns stay row-aligned. */
.iop-grid-team-row {
  height: 30px; box-sizing: border-box; flex-shrink: 0;   /* A-731 */
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 10px; background: #f3f1ee; border-bottom: 1px solid #e7e5e4;
}
.iop-grid-team-name { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #57534e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iop-grid-team-meta { font-size: 10px; color: #a8a29e; white-space: nowrap; }
.iop-grid-team-spacer { height: 30px; box-sizing: border-box; flex-shrink: 0; background: #f3f1ee; border-bottom: 1px solid #e7e5e4; }

.iop-sched-filter {
  font-family: inherit; font-size: 12px; font-weight: 600; color: #374151;
  padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff;
  max-width: 200px; cursor: pointer;
}
.iop-sched-filter-clear {
  font-family: inherit; font-size: 11px; font-weight: 700; color: #b91c1c;
  padding: 6px 10px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; cursor: pointer;
}
.iop-crew-chip.filter-on { outline: 2px solid #a16207; outline-offset: 1px; }

/* ── Booking management: click-menu on a job bar + drag-to-reschedule ───────── */
.iop-jobmenu-backdrop { position: fixed; inset: 0; z-index: 10000; background: transparent; }
.iop-jobmenu {
  position: fixed; z-index: 10001; min-width: 212px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 16px 38px -8px rgba(0,0,0,.34); padding: 6px;
  animation: iop-sm-fade 120ms ease-out;
}
.iop-jobmenu-head { padding: 8px 10px 8px; border-bottom: 1px solid #f1f1f1; margin-bottom: 4px; display: flex; flex-direction: column; gap: 1px; }
.iop-jobmenu-head b { font-size: 13px; color: #111; }
.iop-jobmenu-head span { font-size: 11px; color: #6b7280; }
.iop-jobmenu-head .iop-jobmenu-sub { color: #9ca3af; }
.iop-jobmenu-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; background: transparent; border-radius: 8px; font-size: 13px;
  color: #111; cursor: pointer; font-family: inherit;
}
.iop-jobmenu-item:hover { background: #f3f4f6; }
.iop-jobmenu-item.danger { color: #b91c1c; }
.iop-jobmenu-item.danger:hover { background: #fef2f2; }

/* Bars hint at their grab affordance; the cell under the pointer lights up. */
.iop-week-job, .iop-job-card { cursor: grab; }
.iop-dragging, .iop-dragging * { cursor: grabbing !important; user-select: none !important; }
/* Drag ghost MUST ignore pointer hits so elementFromPoint finds the cell below. */
.iop-drag-ghost {
  position: fixed; z-index: 10002; pointer-events: none;
  background: #111; color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 6px; box-shadow: 0 8px 18px rgba(0,0,0,.32);
}
.iop-grid-cell-row.iop-drop-hover { outline: 2px dashed #16a34a; outline-offset: -2px; background: rgba(22,163,74,.09); border-radius: 6px; }

/* ── Post-booking send prompt (email + text, prefilled) ─────────────────────── */
.iop-send-panel {
  background: #fff; border-radius: 16px; width: min(680px, 94vw); max-height: 88vh; overflow: auto;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.45); animation: iop-sm-fade 160ms ease-out;
}
.iop-send-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid #f1f1f1; }
.iop-send-title { font-family: Syne, sans-serif; font-size: 19px; font-weight: 800; color: #111; }
.iop-send-body { padding: 16px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .iop-send-body { grid-template-columns: 1fr; } }
.iop-send-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.iop-send-card-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; }
.iop-send-to { font-size: 11px; color: #16a34a; font-weight: 600; }
.iop-send-warn { font-size: 11px; color: #b45309; font-weight: 600; }
.iop-send-input, .iop-send-ta { width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; box-sizing: border-box; resize: vertical; }
.iop-send-btn { margin-top: 2px; border: 0; border-radius: 9px; padding: 9px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.iop-send-btn.primary { background: #facc15; color: #000; }
.iop-send-btn.primary:hover { background: #eab308; color: #000; }
.iop-send-empty { font-size: 12px; color: #9ca3af; font-style: italic; padding: 8px 0; }
.iop-send-foot { padding: 6px 20px 18px; display: flex; justify-content: flex-end; }
.iop-send-skip { background: transparent; border: 0; color: #6b7280; font-size: 13px; cursor: pointer; padding: 8px 12px; }
.iop-send-skip:hover { color: #111; text-decoration: underline; }

/* ── Hover detail card (Ascora-style) ───────────────────────────────────────── */
.iop-hovercard {
  position: fixed; z-index: 10002; width: 332px; max-width: 92vw; pointer-events: auto;
  background: #14161a; color: #e8eaed; border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 18px 44px -10px rgba(0,0,0,.6); font-size: 12.5px; line-height: 1.45;
  animation: iop-sm-fade 120ms ease-out;
}
.iop-hc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.iop-hc-head b { font-family: Syne, sans-serif; font-size: 15px; color: #fff; }
.iop-hc-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: #16a34a; color: #fff; }
/* A-640 — the job's workflow status, named in words on every bar hover. */
/* A-641 — whose numbers the KPI band is showing, when a crew is selected. */
.iop-kpi-scope { font-size: 9.5px; font-weight: 800; letter-spacing: .03em; padding: 2px 6px; border-radius: 10px; background: #eef2ff; color: #4338ca; margin-left: 5px; white-space: nowrap; }
.iop-hc-jobstatus { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #dfe3e8; margin-bottom: 6px; }
.iop-hc-jsdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.iop-hc-name { font-weight: 700; color: #fff; margin-bottom: 8px; }
.iop-hc-ph { font-weight: 500; color: #9aa0a6; font-size: 11.5px; }
.iop-hc-row { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; color: #cbd0d6; }
.iop-hc-i { width: 16px; flex: 0 0 16px; text-align: center; opacity: .9; }
.iop-hc-block { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.1); }
.iop-hc-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8a9099; margin-bottom: 4px; }
.iop-hc-notes { color: #dfe3e8; white-space: pre-wrap; max-height: 88px; overflow: auto; }
.iop-hc-comm { color: #cbd0d6; margin-bottom: 8px; }
.iop-hc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.iop-hc-act { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.iop-hc-act:hover { background: rgba(255,255,255,.2); }
.iop-hc-status.unscheduled { background: #6b7280; }

/* Hover card — communications list + scroll cap (high-UI) */
.iop-hovercard { max-height: min(560px, 86vh); overflow: auto; }
.iop-hc-commlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 156px; overflow: auto; }
.iop-hc-commrow { display: flex; gap: 9px; align-items: flex-start; }
.iop-hc-cicon { width: 18px; flex: 0 0 18px; text-align: center; opacity: .92; }
.iop-hc-cmeta { flex: 1; min-width: 0; }
.iop-hc-ctop { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.iop-hc-ctitle { font-weight: 600; color: #e8eaed; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iop-hc-ctime { color: #8a9099; font-size: 11px; flex: 0 0 auto; }
.iop-hc-cprev { color: #aab0b6; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Send prompt — sweep queue: sent state + footer spacing */
.iop-send-foot { gap: 8px; }
.iop-send-btn.sent { background: #16a34a; cursor: default; }

/* ───────────────────────────────────────────────────────────────────────────
   F2 — on-leave "Not available" cell + Suggest-cover button.
   A loud, breathing red alert the install manager cannot miss, with a clean
   one-tap cover action. Additive: .iop-cell-unavail had no rules before.
   ─────────────────────────────────────────────────────────────────────────── */
/* White-padded cell → the red card floats with an even white gutter on every side. */
.iop-grid-cell.iop-cell-unavail {
  cursor: default; overflow: visible;
  display: flex; align-items: stretch;
  background: #fff; padding: 6px;
}
.iop-grid-cell.iop-cell-unavail:hover { background: #fff; }
/* The red card itself breathes; a soft radar wave radiates from its rounded edge.
   Wave lives on the card's ::after so it never blocks the button click. */
.iop-unavail-inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-width: 0; padding: 5px 6px;
  border-radius: 9px; background: #FEE2E2;
  animation: iop-unavail-breathe 1.5s ease-in-out infinite;
}
.iop-unavail-inner::after {
  content: ''; position: absolute; inset: 0; border-radius: 9px; pointer-events: none; z-index: 2;
  animation: iop-unavail-wave 1.6s ease-out infinite;
}
@keyframes iop-unavail-breathe {
  0%, 100% { background: #FEE2E2; box-shadow: inset 0 0 0 1px rgba(220,38,38,.30); }
  50%      { background: #FB7185; box-shadow: inset 0 0 0 1.5px rgba(220,38,38,.65); }
}
@keyframes iop-unavail-wave {   /* softer: smaller reach + lower opacity than before */
  0%   { box-shadow: 0 0 0 0 rgba(220,38,38,.38); }
  75%  { box-shadow: 0 0 0 7px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.iop-unavail-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #991B1B; white-space: nowrap;
}
.iop-unavail-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #DC2626; flex: none;
  animation: iop-unavail-dot 1s ease-in-out infinite;
}
@keyframes iop-unavail-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.75); }
  50%      { box-shadow: 0 0 0 7px rgba(220,38,38,0); }
}
.iop-cover-btn {
  border: 0; cursor: pointer; max-width: 100%;
  background: #facc15; color: #000;
  font: 800 10.5px/1 inherit; letter-spacing: .015em;
  padding: 6px 11px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  box-shadow: 0 2px 7px rgba(250,204,21,.4);
  transition: background 140ms, transform 90ms, box-shadow 140ms;
}
.iop-cover-btn:hover { background: #eab308; color: #000; box-shadow: 0 3px 10px rgba(250,204,21,.5); }
.iop-cover-btn:active { transform: scale(.95); }
.iop-cover-btn:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(250,204,21,.45); }
.iop-cover-bolt { font-size: 12px; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .iop-unavail-inner { animation: none; background: #FCA5A5; box-shadow: inset 0 0 0 2px rgba(220,38,38,.55); }
  .iop-unavail-inner::after { animation: none; }
  .iop-unavail-dot { animation: none; }
}

/* ───────────────────────────────────────────────────────────────────────────
   A-515 — Install money gate: a booking whose SECOND 45% (pre-installation
   progress claim) has not been paid AND reconciled pulses red on the board
   until it is. Deliberately a red RING + money chip rather than a red fill,
   so it reads on top of the existing status colours (green / amber / purple)
   and stays distinguishable from the .at-risk factory alert.
   Source of truth: modules/_lib/payment-status.js → secondFortyFive.
   ─────────────────────────────────────────────────────────────────────────── */
/* OPACITY-ONLY pulse, deliberately. A whole week of unpaid bookings can be
   ~80 bars animating at once; keyframing box-shadow (as .at-risk does) repaints
   every frame and measured +125ms on a 120-bar board paint. Animating opacity
   on a single static-ring pseudo-element is composited — same look, ~0 cost.
   Verified: e2e/offline-harness/a515-schedule-payment-pulse.mjs. */
@keyframes iop-pay-blink { 0%, 100% { opacity: 1; } 50% { opacity: .16; } }
/* Defined AFTER .at-risk so an at-risk + unpaid bar still shows the money ring
   (same specificity — source order wins); the red .at-risk fill stays. */
.iop-week-job.iop-pay-alert,
.iop-job-card.iop-pay-alert,
.iop-vday-bar.iop-pay-alert { position: relative; }
/* A REAL element, not ::after — .iop-job-card::after already carries A-514's ⏳
   client-pick marker and .iop-job-card::before the .at-risk dot, so a bar that
   is unpaid AND one of those would silently lose the other's pseudo-element.
   One <i> per pulsing bar is cheap and cannot collide with anyone. */
.iop-pay-ring {
  position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 6;
  box-shadow: inset 0 0 0 2px #EF4444;          /* static — never keyframed */
  animation: iop-pay-blink 1.5s ease-in-out infinite;
}
/* Past its due date — same language, louder and faster. */
.iop-pay-overdue .iop-pay-ring {
  box-shadow: inset 0 0 0 2.5px #DC2626;
  animation-duration: .95s;
}

/* The money chip on the bar — white on red so it survives every bar colour. */
.iop-week-job .wj-client.has-pay { display: flex; align-items: center; gap: 4px; }
.iop-week-job .wj-client.has-pay .wj-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-week-job .wj-client.has-pay .wj-pay { flex: 0 0 auto; margin-left: 0; }
.iop-week-job .wj-pay,
.iop-job-card .jc-pay {
  display: inline-block; margin-left: 5px; vertical-align: middle;
  background: #fff; color: #B91C1C; text-shadow: none;
  font-size: 8.5px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase;
  line-height: 1.55; padding: 0 4px; border-radius: 3px; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(220,38,38,.4);
}
.iop-vday-bar .vd-pay {
  display: inline-block; margin-right: 4px;
  background: #fff; color: #B91C1C; font-weight: 900; font-size: 9px;
  line-height: 1.35; padding: 0 3px; border-radius: 3px;
}

/* ── Hover card → Payments block (mirrors the job's Progress Claims tab) ──── */
.iop-hc-hold {
  display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px;
  font-size: 9px; font-weight: 800; letter-spacing: .04em;
  background: rgba(239,68,68,.16); color: #FCA5A5; border: 1px solid rgba(239,68,68,.38);
}
.iop-hc-hold.sp-hold-onboarding { background: rgba(59,130,246,.16); color: #93C5FD; border-color: rgba(59,130,246,.4); }
.iop-hc-hold.sp-hold-production { background: rgba(249,115,22,.16); color: #FDBA74; border-color: rgba(249,115,22,.4); }
.iop-hc-hold.sp-hold-recovery   { background: rgba(236,72,153,.16); color: #F9A8D4; border-color: rgba(236,72,153,.4); }
.iop-hc-paysum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.iop-hc-paysum > div { background: rgba(255,255,255,.05); border-radius: 8px; padding: 6px 8px; text-align: center; }
.iop-hc-paysum span { display: block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8A9099; }
.iop-hc-paysum b { display: block; margin-top: 2px; font-family: Syne, sans-serif; font-size: 12.5px; font-weight: 800; }
.iop-hc-paysum b.ok   { color: #4ADE80; }
.iop-hc-paysum b.due  { color: #FBBF24; }
.iop-hc-paysum b.late { color: #F87171; }
.iop-hc-paysum b.nil  { color: #6B7280; }
.iop-hc-paybar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.iop-hc-paybar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #16A34A, #4ADE80); }
.iop-hc-paypct { font-size: 10.5px; color: #8A9099; margin: 4px 0 8px; }
/* Tall enough that the standard 4-stage 5/45/45/5 schedule always fits
   whole; variations scroll (a clipped row is the scroll affordance). */
.iop-hc-stages { display: flex; flex-direction: column; gap: 5px; max-height: 240px; overflow: auto; }
/* Two lines per stage — name + amount, then the money detail + status pill.
   One line could not hold "Pre-Installation (45%) · $6,030.00 · 12D OVERDUE"
   at 332px without eating the stage name. */
.iop-hc-stage {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; border-radius: 7px; background: rgba(255,255,255,.045);
  border-left: 2px solid transparent;
}
.iop-hc-stage .hc-st-dot { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #6B7280; }
.iop-hc-stage .hc-st-body { flex: 1; min-width: 0; }
.iop-hc-stage .hc-st-r1 { display: flex; align-items: baseline; gap: 8px; }
.iop-hc-stage .hc-st-r2 { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.iop-hc-stage .hc-st-nm { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 700; color: #E8EAED; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-hc-stage .hc-st-sub { flex: 1; min-width: 0; font-size: 10px; font-weight: 500; color: #8A9099; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-hc-stage .hc-st-amt { flex: 0 0 auto; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; font-weight: 700; color: #F1F3F5; }
.iop-hc-stage .hc-st-pill {
  flex: 0 0 auto; padding: 2px 6px; border-radius: 999px; white-space: nowrap;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  background: rgba(255,255,255,.08); color: #CBD0D6;
}
/* Stage colours = the Progress Claims tab palette, tuned for the dark card. */
.iop-hc-stage.paid    .hc-st-dot { background: #22C55E; }
.iop-hc-stage.paid    .hc-st-pill { background: rgba(34,197,94,.18); color: #6EE7A8; }
.iop-hc-stage.partial .hc-st-dot { background: #F59E0B; }
.iop-hc-stage.partial .hc-st-pill { background: rgba(245,158,11,.18); color: #FCD34D; }
.iop-hc-stage.billed  .hc-st-dot { background: #3B82F6; }
.iop-hc-stage.billed  .hc-st-pill { background: rgba(59,130,246,.2); color: #93C5FD; }
.iop-hc-stage.awaiting .hc-st-dot { background: #D97706; }
.iop-hc-stage.awaiting .hc-st-pill { background: rgba(217,119,6,.2); color: #FDBA74; }
.iop-hc-stage.zip     .hc-st-dot { background: #7C3AED; }
.iop-hc-stage.zip     .hc-st-pill { background: rgba(124,58,237,.22); color: #C4B5FD; }
.iop-hc-stage.overdue .hc-st-dot { background: #EF4444; }
.iop-hc-stage.overdue .hc-st-pill { background: rgba(239,68,68,.2); color: #FCA5A5; }
.iop-hc-stage.overdue { background: rgba(239,68,68,.1); }
.iop-hc-stage.is-gate { border-left-color: #EF4444; background: rgba(239,68,68,.13); }
.iop-hc-payalert {
  margin-top: 8px; padding: 7px 9px; border-radius: 8px; font-size: 11px; line-height: 1.45;
  background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.4); color: #FECACA;
}
.iop-hc-payalert b { color: #fff; font-weight: 800; }
.iop-hc-payalert span { display: block; margin-top: 2px; font-size: 10px; color: #F3A6A6; }
.iop-hc-payalert.late { position: relative; }
.iop-hc-payalert.late::after {
  content: ''; position: absolute; inset: -1px; border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(239,68,68,.85); animation: iop-pay-blink 1.5s ease-in-out infinite;
}
.iop-hc-payok { margin-top: 8px; font-size: 10.5px; font-weight: 600; color: #86EFAC; }
.iop-hc-payok.zip { color: #C4B5FD; }

@media (prefers-reduced-motion: reduce) {
  /* Ring stays — it is the signal; only the blink stops. */
  .iop-pay-ring, .iop-hc-payalert.late::after { animation: none; opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   A-542 — Booking types on the Installation Schedule
   (1) the "what are we booking?" chooser, (2) the service-call parts gate,
   (3) the high-UI service briefing bubble, (4) service bars on the board.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── (1) Booking-type chooser ─────────────────────────────────────────────── */
.sbt-wrap { flex: 1; overflow-y: auto; padding: 8px 18px 4px; }
.sbt-client { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 2px 0 12px; }
.sbt-client b { font-family: Syne, sans-serif; font-size: 15px; font-weight: 900; color: var(--ink,#0A0A0A); }
.sbt-client span { font-size: 12.5px; font-weight: 700; color: var(--s600,#57534E); }
.sbt-client .sbt-status { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--s500,#78716C); background: var(--s100,#F5F5F4); border-radius: 999px; padding: 3px 9px; }
.sbt-q { font-size: 13px; font-weight: 800; color: var(--ink,#0A0A0A); margin-bottom: 10px; }
.sbt-cards { display: flex; flex-direction: column; gap: 9px; padding-bottom: 6px; }
.sbt-card {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid var(--s200,#E7E5E4); background: #fff; border-radius: 13px; padding: 13px 14px;
  transition: border-color 140ms, box-shadow 140ms, transform 140ms, background 140ms;
}
.sbt-card:hover { border-color: var(--sbt-accent,#a16207); transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(0,0,0,.22); }
.sbt-card.on { border-color: var(--sbt-accent,#a16207); background: color-mix(in srgb, var(--sbt-accent,#a16207) 5%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sbt-accent,#a16207) 14%, transparent); }
.sbt-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: color-mix(in srgb, var(--sbt-accent,#a16207) 12%, #fff); }
.sbt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sbt-name { font-size: 14px; font-weight: 900; color: var(--ink,#0A0A0A); display: flex; align-items: center; gap: 7px; }
.sbt-sugg { font-style: normal; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--sbt-accent,#a16207); background: color-mix(in srgb, var(--sbt-accent,#a16207) 12%, #fff); border-radius: 999px; padding: 2px 7px; }
.sbt-blurb { font-size: 12px; font-weight: 700; color: var(--s600,#57534E); }
.sbt-steps { font-size: 11px; font-weight: 600; color: var(--s400,#A8A29E); line-height: 1.45; }
.sbt-note { margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--sbt-accent,#a16207); }
.sbt-chev { flex: none; align-self: center; color: var(--s300,#D6D3D1); }
.sbt-card:hover .sbt-chev { color: var(--sbt-accent,#a16207); }

/* ── (2) Service-call parts gate (inside the booking form) ────────────────── */
.iop-svcp { margin-top: 12px; border: 1px solid var(--s200,#E7E5E4); border-radius: 12px; padding: 11px 12px; background: var(--s50,#FAFAF9); }
.iop-svcp-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 900; color: var(--ink,#0A0A0A); }
.iop-svcp-sum { font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-align: right; }
.iop-svcp-sum.ok   { background: rgba(22,163,74,.12);  color: #15803D; }
.iop-svcp-sum.warn { background: rgba(217,119,6,.14);  color: #B45309; }
.iop-svcp-sum.bad  { background: rgba(220,38,38,.12);  color: #B91C1C; }
.iop-svcp-list { margin: 8px 0 2px; display: flex; flex-direction: column; gap: 4px; max-height: 168px; overflow-y: auto; }
.iop-svcp-none { font-size: 11.5px; font-weight: 600; color: var(--s400,#A8A29E); padding: 2px 0 4px; }
.iop-svcp-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; background: #fff; border: 1px solid var(--s200,#E7E5E4); border-radius: 8px; padding: 5px 9px; }
.iop-svcp-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--s300,#D6D3D1); }
.iop-svcp-row.ok      .iop-svcp-dot { background: #16A34A; }
.iop-svcp-row.warn    .iop-svcp-dot { background: #D97706; }
.iop-svcp-row.bad     .iop-svcp-dot { background: #DC2626; }
.iop-svcp-row.unknown .iop-svcp-dot { background: #94A3B8; }
.iop-svcp-nm { flex: 1; min-width: 0; font-weight: 700; color: var(--ink,#0A0A0A); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iop-svcp-st { flex: none; font-weight: 700; color: var(--s500,#78716C); }
.iop-svcp-row.bad .iop-svcp-st { color: #B91C1C; }
.iop-svcp-ask { margin: 10px 0 6px; font-size: 11.5px; font-weight: 900; color: var(--ink,#0A0A0A); }
.iop-svcp-opt { display: flex; align-items: flex-start; gap: 9px; background: #fff; border: 1.5px solid var(--s200,#E7E5E4); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; transition: border-color 140ms, background 140ms; }
.iop-svcp-opt:hover { border-color: var(--s300,#D6D3D1); }
.iop-svcp-opt.on { border-color: var(--red,#a16207); background: rgba(250,204,21,.04); }
.iop-svcp-opt.off { opacity: .5; cursor: not-allowed; }
.iop-svcp-opt input { accent-color: var(--red,#a16207); width: 15px; height: 15px; flex: none; margin-top: 2px; cursor: pointer; }
.iop-svcp-opt span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.iop-svcp-opt b { font-size: 12.5px; font-weight: 800; color: var(--ink,#0A0A0A); }
.iop-svcp-opt em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--s500,#78716C); }
.iop-svcp-warn { font-size: 11px; font-weight: 800; color: #B45309; }

/* ── (3) Service briefing bubble ──────────────────────────────────────────── */
.sbb-overlay {
  position: fixed; inset: 0; z-index: 10050; background: rgba(10,10,10,.6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 16px;
  animation: iop-sm-fade 150ms ease-out;
}
.sbb-panel {
  width: 100%; max-width: 860px; max-height: 88vh; display: flex; flex-direction: column;
  background: #14161a; color: #e8eaed; border-radius: 16px; overflow: hidden;
  box-shadow: 0 26px 70px -14px rgba(0,0,0,.7);
  font-size: 12.5px; line-height: 1.45;
  animation: iop-sm-rise 220ms cubic-bezier(.16,1,.3,1);
}
.sbb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 13px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sbb-eyebrow { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #A78BFA; }
.sbb-title { font-family: Syne, sans-serif; font-size: 18px; font-weight: 800; color: #fff; margin-top: 3px; }
.sbb-x { border: 0; background: rgba(255,255,255,.1); color: #fff; width: 30px; height: 30px; border-radius: 9px; font-size: 19px; line-height: 1; cursor: pointer; flex: none; }
.sbb-x:hover { background: rgba(255,255,255,.2); }
.sbb-body { flex: 1; overflow-y: auto; padding: 4px 18px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 720px) { .sbb-body { grid-template-columns: 1fr; } }
.sbb-col { min-width: 0; }
.sbb-col .iop-hc-block:first-child { border-top: 0; margin-top: 4px; padding-top: 4px; }
.sbb-kv { display: flex; gap: 10px; padding: 3px 0; align-items: baseline; }
.sbb-kv > span { flex: 0 0 108px; color: #8A9099; font-weight: 700; font-size: 11px; }
.sbb-kv > b { flex: 1; min-width: 0; color: #E8EAED; font-weight: 700; overflow-wrap: anywhere; }
.sbb-parts-sum { font-size: 11.5px; font-weight: 800; padding: 5px 9px; border-radius: 8px; margin-bottom: 7px; }
.sbb-parts-sum.ok   { background: rgba(34,197,94,.16);  color: #6EE7A8; }
.sbb-parts-sum.warn { background: rgba(245,158,11,.16); color: #FCD34D; }
.sbb-parts { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.sbb-part { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.05); border-radius: 8px; padding: 5px 9px; }
.sbb-part-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #6B7280; }
.sbb-part.ok      .sbb-part-dot { background: #22C55E; }
.sbb-part.warn    .sbb-part-dot { background: #F59E0B; }
.sbb-part.bad     .sbb-part-dot { background: #EF4444; }
.sbb-part.unknown .sbb-part-dot { background: #94A3B8; }
.sbb-part-nm { flex: 1; min-width: 0; font-weight: 700; color: #E8EAED; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbb-part-nm em { font-style: normal; color: #8A9099; font-weight: 600; }
.sbb-part-st { flex: none; font-size: 11px; font-weight: 700; color: #8A9099; }
.sbb-part.bad .sbb-part-st { color: #FCA5A5; }
.sbb-notes { display: flex; flex-direction: column; gap: 7px; max-height: 230px; overflow-y: auto; }
.sbb-note { background: rgba(255,255,255,.05); border-radius: 9px; padding: 7px 10px; }
.sbb-note-h { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #8A9099; margin-bottom: 3px; }
.sbb-note-b { color: #DFE3E8; white-space: pre-wrap; overflow-wrap: anywhere; }
.sbb-comms { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.sbb-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.sbb-foot-hint { flex: 1; font-size: 11px; font-weight: 600; color: #8A9099; }
.sbb-btn { border: 0; border-radius: 9px; padding: 8px 15px; font-size: 12.5px; font-weight: 800; cursor: pointer; background: var(--fos-plate); color: var(--fos-on-plate); }
.sbb-btn:hover { background: var(--fos-plate-hover); color: var(--fos-on-plate); }
.sbb-btn.ghost { background: rgba(255,255,255,.1); color: #fff; }
.sbb-btn.ghost:hover { background: rgba(255,255,255,.2); }

/* ── (4) Booked service calls on the board ────────────────────────────────── */
.iop-week-job.sbt-svc-bar {
  background: linear-gradient(135deg,#7C3AED,#5B21B6); border-color: #6D28D9; color: #fff; cursor: pointer;
}
.iop-week-job.sbt-svc-bar b, .iop-week-job.sbt-svc-bar .wj-client { color: #fff; }
.iop-week-job.sbt-svc-bar:hover { filter: brightness(1.08); }
.iop-vday-bar.sbt-svc-vbar { background: #7C3AED; cursor: pointer; }

/* ── (5) A-550 — booked CHECK MEASURES on the board ────────────────────────── */
/* Blue, so the board's three booking types read apart at a glance: install =
   green, service call = purple, check measure = blue. A completed CM greys out
   rather than disappearing — the visit happened on that day. */
.iop-week-job.sbt-cm-bar {
  background: linear-gradient(135deg,#2563EB,#1D4ED8); border-color: #1E40AF; color: #fff; cursor: pointer;
}
.iop-week-job.sbt-cm-bar b, .iop-week-job.sbt-cm-bar .wj-client { color: #fff; }
.iop-week-job.sbt-cm-bar:hover { filter: brightness(1.08); }
.iop-week-job.sbt-cm-bar.done {
  background: linear-gradient(135deg,#64748B,#475569); border-color: #475569; opacity: .82;
}
.iop-vday-bar.sbt-cm-vbar { background: #2563EB; cursor: pointer; }
.iop-vday-bar.sbt-cm-vbar.done { background: #64748B; opacity: .82; }
/* Legend swatches for the two non-install booking types. */
.iop-legend-sw.sw-svc { background: linear-gradient(135deg,#7C3AED,#5B21B6); }
.iop-legend-sw.sw-cm  { background: linear-gradient(135deg,#2563EB,#1D4ED8); }
/* Non-install bookings on a lane, so x/40h "Empty" can't contradict the bars. */
.iop-installer-extra { font-weight: 800; color: #1D4ED8; white-space: nowrap; }
