/* ══════════════════════════════════════════════════════════════
   PROJECT BUILDER DRAWER — Project-specific styles only.
   Reuses .wk-pbd-* classes from program-builder-drawer.css for the
   shared scaffolding (overlay, header, TOC, fields, footer).
   This file adds .wk-pjd-* rules for the bits unique to projects:
     - the readonly "Inherits from" pill
     - the contacts roster + picked list
     - the multi-line budget rows
     - the wider textarea field
   ══════════════════════════════════════════════════════════════ */

/* The drawer reuses .wk-pbd-overlay's z-index (1100). Bump it past the
   engagement profile (12000), project profile (13000), AND the wdp
   program/task popup (55000) — when "+ Project" is fired from inside
   the wdp popup, the drawer was getting pinned behind it because it
   only sat at 13500.
   67000 (was 65000): the engagement profile is lifted to 66000 whenever a
   builder has locked the body (goal-builder-drawer.css `body.wk-pbd-locked
   .gp-overlay`). Since THIS drawer itself adds wk-pbd-locked, 65000 left "+ Work
   Stream" pinned BEHIND the profile it was launched from. 67000 clears the
   66000 locked profile and the wdp/task popups, and stays below the materials
   browser (70000) / legacy quick-modals (250000) it can spawn. */
.wk-pjd-overlay { z-index: 67000 !important; }
/* Capture mode opens from inside the Template builder modal (z-index 2000000),
   so it must clear that to render in front instead of behind. */
.wk-pjd-overlay.wk-pjd--capture { z-index: 2000300 !important; }

/* ══════════════════════════════════════════════════════════
   STEP-PAGED MODE — one section at a time (active tab swaps)
   ══════════════════════════════════════════════════════════ */

/* Tab strip — make tabs feel like proper steps, not just TOC chips.
   Active tab gets a strong primary fill so the user always knows where
   they are in the flow. */
.wk-pbd-steps--paged {
  display: flex;
  gap: 6px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}
.wk-pbd-step--paged {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: #64748b;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.wk-pbd-step--paged:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: translateY(-1px);
}
.wk-pbd-step--paged .wk-pbd-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  transition: all 0.18s;
}
.wk-pbd-step--paged.is-done {
  background: #ecfdf5;
  color: #047857;
  border-color: #99f6e4;
}
.wk-pbd-step--paged.is-done .wk-pbd-step-num {
  background: #10b981; color: #fff;
}
.wk-pbd-step--paged.is-active {
  background: var(--wt-theme-primary-mist, #eef2ff);
  color: var(--wt-theme-primary-dark, #4338ca);
  border-color: var(--wt-theme-primary, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.wk-pbd-step--paged.is-active .wk-pbd-step-num {
  background: var(--wt-theme-primary, #4f46e5); color: #fff;
}
/* Active + done — stay primary so the active state is never lost. */
.wk-pbd-step--paged.is-active.is-done {
  background: var(--wt-theme-primary-mist, #eef2ff);
  color: var(--wt-theme-primary-dark, #4338ca);
  border-color: var(--wt-theme-primary, #4f46e5);
}
.wk-pbd-step--paged.is-active.is-done .wk-pbd-step-num {
  background: var(--wt-theme-primary, #4f46e5);
}

/* In paged mode the body shows ONE section, so drop the dashed bottom
   divider from .wk-pbd-section-block — there's nothing under it. */
.wk-pjd-body--paged .wk-pbd-section-block {
  border-bottom: none;
  padding-top: 8px;
}

/* Allow native dropdowns / date pickers from the inputs in this section
   to render without being clipped by the body's overflow:auto. The body
   itself still scrolls vertically when content overflows; this only
   affects positioned popups (date pop, combobox panel) which we ALSO
   override below to be position:fixed-equivalent via stacking context. */
.wk-pjd-body--paged { overflow-y: auto; overflow-x: visible; }

/* Make sub-popups inside the drawer always render above the sticky tab
   strip and the section header. The drawer itself is at z-index 13500;
   these are *relative* z-indexes inside the drawer's stacking context. */
.wk-pjd-drawer .wk-pbd-date-pop,
.wk-pjd-drawer .wk-pbd-combo-panel {
  z-index: 200;
}

/* ══════════════════════════════════════════════════════════
   ACTION BUTTONS — beef up "+ Add task / + Add budget line /
   + Link document" so they feel like real CTAs, not afterthoughts.
   ══════════════════════════════════════════════════════════ */
.wk-pjd-drawer .wk-pbd-mini {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1.5px solid var(--wt-theme-primary, #4f46e5);
  background: var(--wt-theme-primary-mist, #eef2ff);
  color: var(--wt-theme-primary-dark, #4338ca);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.08);
}
.wk-pjd-drawer .wk-pbd-mini:hover {
  background: var(--wt-theme-primary, #4f46e5);
  color: #fff;
  border-color: var(--wt-theme-primary, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.35);
}
.wk-pjd-drawer .wk-pbd-mini:active { transform: translateY(0); }

/* The "× remove row" buttons inside Plan and Budgets — give them a
   uniform circular shape so the rows feel deliberate, not stamped. */
.wk-pjd-drawer .wk-pbd-bucket-del,
.wk-pjd-drawer .wk-pbd-row-del {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.wk-pjd-drawer .wk-pbd-bucket-del:hover:not([disabled]),
.wk-pjd-drawer .wk-pbd-row-del:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

/* Row-level inputs in the plan grid — give them a touch more breathing
   room so the row is comfortably clickable. */
.wk-pjd-drawer .wk-pbd-grid-row { min-height: 48px; }
.wk-pjd-drawer .wk-pbd-cell { font-size: 13.5px; }

/* Budget row inputs — match the plan-grid breathing room. */
.wk-pjd-drawer .wk-pjd-budget-row { padding: 4px 0; }

/* ── Footer back button alignment ──────────────────────── */
.wk-pjd-drawer .wk-pbd-foot { gap: 10px; }

/* ── readonly inheritance pill ────────────────────────────── */
.wk-pjd-readonly {
  background: #f8fafc !important;
  color: #475569 !important;
  cursor: default;
  border-style: dashed !important;
}
.wk-pjd-readonly:focus {
  border-color: #e2e8f0 !important;
  box-shadow: none !important;
}

/* ── description textarea ─────────────────────────────────── */
.wk-pjd-textarea {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   INLINE SUB-HEADING — for "Main contacts" inside Basics
   (lighter weight than a full section header so the contacts
    block reads as part of Basics, not as its own section)
   ══════════════════════════════════════════════════════════ */
.wk-pjd-subhead {
  margin: 24px 0 12px;
  padding-top: 18px;
  border-top: 1px dashed #e2e8f0;
}
.wk-pjd-subhead-title {
  font-size: 14px; font-weight: 700; color: #0f172a;
  letter-spacing: -0.01em;
}
.wk-pjd-subhead-sub {
  font-size: 12px; color: #94a3b8;
  margin-top: 3px;
}

/* ══════════════════════════════════════════════════════════
   CONTACTS — folded into Basics (no longer its own section)
   ══════════════════════════════════════════════════════════ */
.wk-pjd-empty {
  padding: 16px 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}
.wk-pjd-empty--small { padding: 10px 14px; font-size: 12.5px; }

/* picked contacts list */
.wk-pjd-contacts-picked {
  display: flex; flex-direction: column; gap: 8px;
}
.wk-pjd-contact-row {
  display: grid;
  grid-template-columns: 1fr 160px 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  animation: wkPjdRowIn 0.18s ease-out;
}
@keyframes wkPjdRowIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wk-pjd-contact-info { min-width: 0; }
.wk-pjd-contact-name {
  font-size: 13.5px; font-weight: 600; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-pjd-contact-sub {
  font-size: 11.5px; color: #94a3b8;
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-pjd-contact-role {
  padding: 7px 10px !important;
  font-size: 12.5px !important;
  font-weight: 600;
}
.wk-pjd-contact-rm {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid #e2e8f0; background: #fff;
  color: #94a3b8; cursor: pointer;
  font-size: 18px; line-height: 1;
  transition: all 0.15s;
}
.wk-pjd-contact-rm:hover {
  color: #dc2626; border-color: #fca5a5; background: #fef2f2;
}

/* program roster picker */
.wk-pjd-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.wk-pjd-roster-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit; text-align: left;
  transition: all 0.15s;
}
.wk-pjd-roster-item:hover {
  border-color: var(--wt-theme-primary, #4f46e5);
  background: var(--wt-theme-primary-mist, #eef2ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.18);
}
.wk-pjd-roster-info { flex: 1; min-width: 0; }
.wk-pjd-roster-name {
  font-size: 13.5px; font-weight: 600; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-pjd-roster-sub {
  font-size: 11.5px; color: #94a3b8;
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-pjd-roster-add {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--wt-theme-primary-mist, #eef2ff);
  color: var(--wt-theme-primary, #4f46e5);
  font-size: 16px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.wk-pjd-roster-item:hover .wk-pjd-roster-add {
  background: var(--wt-theme-primary, #4f46e5);
  color: #fff;
}

/* ── Work Stream lead — select-only person picker ────────────── */
.wk-pjd-pick { position: relative; }
.wk-pjd-pick-input { padding-right: 34px; }
.wk-pjd-pick-input.is-picked {
  border-color: var(--wt-theme-primary, #4f46e5);
  background: var(--wt-theme-primary-mist, #eef2ff);
  font-weight: 600;
  color: #0f172a;
}
.wk-pjd-pick-clear {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #e2e8f0; color: #475569;
  font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.wk-pjd-pick-clear:hover { background: #cbd5e1; color: #1e293b; }
.wk-pjd-pick-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 200;
  max-height: 260px; overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.22);
  padding: 4px;
}
.wk-pjd-pick-menu[hidden] { display: none; }
.wk-pjd-pick-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: none;
  border-radius: 8px; cursor: pointer; font: inherit;
  transition: background 0.12s;
}
.wk-pjd-pick-item:hover {
  background: var(--wt-theme-primary-mist, #eef2ff);
}
.wk-pjd-pick-name {
  font-size: 13.5px; font-weight: 600; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-pjd-pick-sub {
  font-size: 11.5px; color: #94a3b8; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-pjd-pick-empty {
  padding: 12px 14px; font-size: 12.5px; color: #94a3b8; text-align: center;
}

/* ══════════════════════════════════════════════════════════
   SECTION 2 — PLAN GRID
   (extends .wk-pbd-grid-* for project use)
   ══════════════════════════════════════════════════════════ */
/* Override the grid columns to suit project plan layout */
.wk-pbd-section-block[data-pjd-anchor="2"] .wk-pbd-grid-head,
.wk-pbd-section-block[data-pjd-anchor="2"] .wk-pbd-grid-row {
  grid-template-columns: 130px 1fr 130px 90px 130px 36px;
}
.wk-pbd-section-block[data-pjd-anchor="2"] .wk-pbd-cell {
  border: none;
  border-right: 1px solid #f1f5f9;
  background: transparent;
  padding: 10px 11px;
  font: inherit; font-size: 13px; color: #0f172a;
  outline: none;
}
.wk-pbd-section-block[data-pjd-anchor="2"] .wk-pbd-cell:last-of-type { border-right: none; }
.wk-pbd-section-block[data-pjd-anchor="2"] .wk-pbd-cell:focus {
  background: #eef2ff;
  box-shadow: inset 0 0 0 1.5px var(--wt-theme-primary, #4f46e5);
}
.wk-pjd-cell-hrs { text-align: right; }
.wk-pjd-row-add { margin-left: auto; }

/* ══════════════════════════════════════════════════════════
   SECTION 3 — BUDGETS
   ══════════════════════════════════════════════════════════ */
.wk-pjd-bud-cols {
  display: grid;
  grid-template-columns: 1fr 150px 130px 150px 36px;
  gap: 10px;
  flex: 1;
  font-size: 10.5px; font-weight: 700;
  color: #64748b; text-transform: uppercase; letter-spacing: 0.06em;
  align-items: center;
  padding-right: 12px;
}
.wk-pjd-budgets {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px;
}
.wk-pjd-budget-row {
  display: grid;
  grid-template-columns: 1fr 150px 130px 150px 36px;
  gap: 10px;
  align-items: center;
  animation: wkPjdRowIn 0.18s ease-out;
}
.wk-pjd-bud-money .wk-pbd-input {
  padding-left: 24px;
  text-align: right;
}
.wk-pjd-bud-label,
.wk-pjd-bud-type,
.wk-pjd-bud-fund {
  padding: 10px 12px !important;
  font-size: 13px;
}

/* Section block padding tightening so the sections feel cohesive */
.wk-pbd-section-block[data-pjd-anchor="3"] .wk-pbd-bucket-total {
  margin-top: 14px;
}

/* ══════════════════════════════════════════════════════════
   SECTION 4 — DOCUMENTS
   ══════════════════════════════════════════════════════════ */
.wk-pjd-doc-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.wk-pjd-doc-title {
  font-size: 14px; font-weight: 700; color: #0f172a;
  letter-spacing: -0.01em;
}
.wk-pjd-doc-sub {
  font-size: 12px; color: #94a3b8;
  margin-top: 3px;
}
.wk-pjd-doc-add { flex-shrink: 0; }

.wk-pjd-doc-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 12px;
}
.wk-pjd-doc-row {
  display: grid;
  grid-template-columns: 38px 1fr 24px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: all 0.18s;
  animation: wkPjdRowIn 0.18s ease-out;
}
.wk-pjd-doc-row:hover {
  border-color: var(--wt-theme-primary, #4f46e5);
  background: var(--wt-theme-primary-mist, #eef2ff);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.22);
}
.wk-pjd-doc-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}
.wk-pjd-doc-info {
  display: flex; flex-direction: column;
  min-width: 0;
}
.wk-pjd-doc-name {
  font-size: 13.5px; font-weight: 600; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-pjd-doc-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 3px;
  font-size: 11.5px; color: #94a3b8;
  font-weight: 500;
}
.wk-pjd-doc-source,
.wk-pjd-doc-type,
.wk-pjd-doc-date {
  display: inline-flex; align-items: center;
}
.wk-pjd-doc-source { color: #64748b; font-weight: 600; }
.wk-pjd-doc-type {
  background: #f1f5f9;
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; letter-spacing: 0.04em;
}
.wk-pjd-doc-open {
  font-size: 16px; color: #94a3b8;
  transition: color 0.15s, transform 0.15s;
}
.wk-pjd-doc-row:hover .wk-pjd-doc-open {
  color: var(--wt-theme-primary, #4f46e5);
  transform: translate(2px, -2px);
}

/* Pending (staged) documents — picked but not yet saved. Treated visually
   like sketches: dashed border + amber pending pill, so users know these
   will commit on Create. */
.wk-pjd-doc-row--pending {
  border-style: dashed;
  background: #fffbeb;
}
.wk-pjd-doc-row--pending:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  box-shadow: 0 6px 16px -6px rgba(245, 158, 11, 0.25);
}
.wk-pjd-doc-pending {
  background: #fef3c7;
  color: #92400e;
  padding: 1px 7px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wk-pjd-doc-rm {
  width: 24px; height: 24px;
  border: 1px solid #fcd34d; background: #fffbeb;
  border-radius: 6px;
  color: #b45309;
  font-size: 14px; line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.wk-pjd-doc-rm:hover {
  background: #fde68a;
  border-color: #f59e0b;
  color: #78350f;
}

/* ══════════════════════════════════════════════════════════
   SAVE BUTTON DISABLED STATE
   ══════════════════════════════════════════════════════════ */
.wk-pbd-btn--save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* Mobile / narrow drawer fallbacks */
@media (max-width: 720px) {
  .wk-pjd-roster { grid-template-columns: 1fr; }
  .wk-pjd-contact-row { grid-template-columns: 1fr 130px 32px; }
  .wk-pjd-bud-cols,
  .wk-pjd-budget-row { grid-template-columns: 1fr 110px 110px 110px 32px; }
  .wk-pbd-section-block[data-pjd-anchor="2"] .wk-pbd-grid-head,
  .wk-pbd-section-block[data-pjd-anchor="2"] .wk-pbd-grid-row {
    grid-template-columns: 110px 1fr 110px 70px 110px 32px;
  }
  .wk-pjd-doc-head { flex-direction: column; align-items: stretch; }
  .wk-pjd-doc-add { align-self: flex-start; }
}

/* "no hours estimated" — AI leaves hours blank; flag it softly in yellow */
.wk-pjd-cell-hrs::placeholder { color: #b45309; opacity: .85; font-style: italic; }
.wk-pjd-cell-hrs--none { background: #fffbeb; border-color: #fde68a; }
.wk-pjd-cell-hrs--none:focus { background: #fff; border-color: var(--wt-theme-primary, #4f46e5); }
