/* pr232_planhub.css
   TradeRailPR232 — Plans / PlanHub Integration
   Namespace: pr232-*
   ---------------------------------------------------------- */

/* ── Upload gating ──────────────────────────────────────────
   Hide the Uploads tab and upload drop zone for roles that
   cannot upload. Applied via body class set by JS.
   ---------------------------------------------------------- */
body.pr232-no-upload [data-pill="uploads"],
body.pr232-no-upload .phv9-pill[data-pill="uploads"] {
  display: none !important;
}

body.pr232-no-upload [data-phv9="upload-zone"],
body.pr232-no-upload .phv9-upload-zone,
body.pr232-no-upload .uico,
body.pr232-no-upload [data-test="phv9-upload-zone"] {
  display: none !important;
}

/* ── Field read-only banner ─────────────────────────────────
   Shown at top of PlanHub for field workers to signal
   read-only access.
   ---------------------------------------------------------- */
.pr232-readonly-banner {
  background: #fff8e6;
  border-bottom: 1px solid #f0d080;
  color: #7a5800;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  text-align: center;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ── Field scope — hide projects not in schedule ────────────
   Project picker items are hidden via JS, but ensure no
   orphaned empty states look broken.
   ---------------------------------------------------------- */
body.pr232-field-scoped .phv9-proj-empty {
  font-size: 12px;
  color: #8899aa;
  padding: 16px;
  text-align: center;
}

/* ── Board integration — View Plans menu item ───────────────
   Styled to match p226-menu-item but with a plans accent.
   ---------------------------------------------------------- */
.pr232-view-plans-btn {
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--brand, #FF6B00);
  font-weight: 600;
  border-top: 1px solid #f0f2f5;
  display: block;
}

.pr232-view-plans-btn:hover {
  background: #fff3e8;
}

/* ── PlanHub shell — ensure it fills VillaShell full panel ──
   When opened via VillaShell.openFull(), the PlanHub overlay
   shell should fill 100% of the available content area.
   ---------------------------------------------------------- */
#vsFullPanel .phv9-shell,
#vsFullPanel #phv9OverlayShell,
#vsFullPanel #pr232PlanHubContainer {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* PlanHub overlay shell already has position:fixed — when inside
   VillaShell we reset it to relative so it flows inside the panel */
#vsFullPanel #phv9OverlayShell {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  flex: 1;
  min-height: 0;
}

/* ── MEP filter row — visual separation from discipline row ──
   Defined here as a PR232 addition to supplement planhub_v9.css
   (already has the base styles from the cleanup commit).
   ---------------------------------------------------------- */
.phv9-mep-filter-row {
  background: #fafbfc;
  border-top: 1px solid #ebeff3;
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 34px;
}

.phv9-mep-label {
  font-size: 10px;
  font-weight: 700;
  color: #8899aa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Hide MEP row entirely for field workers — they need clean minimal view */
body.pr232-field-readonly .phv9-mep-filter-row {
  display: none;
}

body.pr232-field-readonly .phv9-disc-filters {
  display: none;
}

/* ── Responsive — sidebar offset already handled by VillaShell ── */
@media (max-width: 767px) {
  .pr232-readonly-banner {
    font-size: 10px;
    padding: 5px 10px;
  }
  .pr232-view-plans-btn {
    font-size: 12px;
    padding: 7px 12px;
  }
}
