/* TradeRail — PR300 Projects Module styles */

/* ─── Content area (Fleet-style positioning) ─── */
#pr300-root {
  position: fixed;
  top: var(--nav-h, 48px);
  left: 16.5rem;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--surface, #f5f5f5);
  display: none;
  flex-direction: column;
  z-index: 10;
}
#pr300-root.pr300-active {
  display: flex;
}

/* Respond to sidebar collapse — shift left edge to match icon-rail width */
@media (min-width: 768px) {
  body.pui1b-mounted.pui1b-collapsed #pr300-root {
    left: 3.5rem;
    transition: left 300ms ease;
  }
  body.pui1b-mounted:not(.pui1b-collapsed) #pr300-root {
    left: 16.5rem;
    transition: left 300ms ease;
  }
}
/* Mobile: offset by icon-rail width (3.5rem = 56px) */
@media (max-width: 767px) {
  body[data-tr-role]:not([data-tr-role="field_tech"]).pui1b-mounted #pr300-root {
    left: 3.5rem !important;
  }
  body[data-tr-role="field_tech"].pui1b-mounted #pr300-root {
    left: 0 !important;
  }
}

/* ─── Page header (Fleet-style) ─── */
.pr300-page-header {
  background: #1A1A2E;
  padding: 18px 24px 0;
  flex-shrink: 0;
}
.pr300-page-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.pr300-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.pr300-lily-line {
  font-size: 12px;
  color: #FF6B00;
  margin: 0 0 10px;
  min-height: 16px;
}
.pr300-tab-ribbon {
  display: flex;
  gap: 0;
  border-bottom: none;
  margin-top: 4px;
}
.pr300-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.pr300-tab:hover { color: #fff; }
.pr300-tab.pr300-tab-active {
  color: #FF6B00;
  border-bottom-color: #FF6B00;
}

/* ─── Landing page ─── */
.pr300-landing {
  padding: 24px;
  flex: 1;
}
.pr300-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.pr300-search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  outline: none;
  max-width: 420px;
}
.pr300-search-input:focus { border-color: #FF6B00; }
.pr300-filter-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pr300-filter-btn {
  padding: 6px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
}
.pr300-filter-btn:hover,
.pr300-filter-btn.pr300-filter-active {
  border-color: #FF6B00;
  color: #FF6B00;
  background: #fff5ee;
}
.pr300-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.pr300-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.pr300-project-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.pr300-project-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: #FF6B00;
}
.pr300-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pr300-card-id {
  font-size: 11px;
  color: #999;
  font-family: monospace;
}
.pr300-card-health {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.pr300-card-health.green { background: #22c55e; }
.pr300-card-health.yellow { background: #f59e0b; }
.pr300-card-health.red { background: #ef4444; }
.pr300-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A2E;
  margin: 0 0 4px;
  line-height: 1.3;
}
.pr300-card-customer {
  font-size: 12px;
  color: #777;
  margin: 0 0 8px;
}
.pr300-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pr300-card-meta-item {
  font-size: 11px;
  color: #999;
}
.pr300-card-meta-item strong {
  color: #555;
  font-weight: 600;
}
.pr300-card-stage {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #f0f4ff;
  color: #3b5bdb;
}
.pr300-attention-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #FF6B00;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.pr300-empty-state {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 14px;
}

/* ─── Project Hub page ─── */
.pr300-hub {
  display: none;
  flex-direction: column;
  flex: 1;
}
.pr300-hub.pr300-hub-active {
  display: flex;
}

/* Scorecard bar */
.pr300-scorecard {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 24px;
  flex-shrink: 0;
  overflow-x: auto;
}
.pr300-scorecard-item {
  padding: 14px 24px 14px 0;
  min-width: 140px;
  flex-shrink: 0;
}
.pr300-scorecard-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.pr300-scorecard-value {
  font-size: 20px;
  font-weight: 700;
  color: #1A1A2E;
}
.pr300-scorecard-value.orange { color: #FF6B00; }
.pr300-scorecard-sub {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

/* Hub tab content */
.pr300-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid #e8e8e8;
  padding: 0 16px;
  flex-shrink: 0;
}
.pr300-hub-tab {
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 500;
  color: #777;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s;
  margin-bottom: -2px;
}
.pr300-hub-tab:hover { color: #1A1A2E; }
.pr300-hub-tab.pr300-hub-tab-active {
  color: #FF6B00;
  border-bottom-color: #FF6B00;
  font-weight: 600;
}
.pr300-hub-tab.pr300-hub-tab-hidden { display: none; }

.pr300-hub-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Back button */
.pr300-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #FF6B00;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
}
.pr300-back-btn:hover { opacity: 0.8; }

/* Tab panel content */
.pr300-tab-panel { display: none; }
.pr300-tab-panel.pr300-panel-active { display: block; }

.pr300-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.pr300-overview-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 16px;
}
.pr300-overview-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pr300-info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}
.pr300-info-row:last-child { border-bottom: none; }
.pr300-info-key { color: #999; }
.pr300-info-val { color: #1A1A2E; font-weight: 500; }

.pr300-contact-list { list-style: none; padding: 0; margin: 0; }
.pr300-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}
.pr300-contact-item:last-child { border-bottom: none; }
.pr300-contact-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FF6B00;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pr300-contact-name { font-weight: 600; color: #1A1A2E; }
.pr300-contact-role { font-size: 11px; color: #999; }

/* Document/item rows */
.pr300-doc-list { list-style: none; padding: 0; margin: 0; }
.pr300-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
  cursor: pointer;
}
.pr300-doc-item:last-child { border-bottom: none; }
.pr300-doc-item:hover { background: #fafafa; }
.pr300-doc-name { color: #1A1A2E; font-weight: 500; }
.pr300-doc-meta { color: #aaa; font-size: 11px; }
.pr300-doc-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.pr300-doc-status.open { background: #fff3e0; color: #FF6B00; }
.pr300-doc-status.approved { background: #e8f5e9; color: #22c55e; }
.pr300-doc-status.pending { background: #f3f4f6; color: #777; }
.pr300-doc-status.submitted { background: #e8f0fe; color: #3b5bdb; }

/* Add button */
.pr300-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  transition: opacity 0.15s;
}
.pr300-add-btn:hover { opacity: 0.9; }

/* Lily insight box */
.pr300-lily-insight {
  background: #fff5ee;
  border: 1px solid #ffe0c8;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #7a3b00;
  margin-bottom: 16px;
  line-height: 1.5;
}
.pr300-lily-insight strong { color: #FF6B00; }

/* Stage progress */
.pr300-stage-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pr300-stage-pill {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  background: #f3f4f6;
  color: #777;
  cursor: default;
}
.pr300-stage-pill.completed {
  background: #e8f5e9;
  color: #22c55e;
}
.pr300-stage-pill.active {
  background: #FF6B00;
  color: #fff;
  font-weight: 700;
}

/* Needs attention row */
.pr300-needs-attention {
  background: #fff8f5;
  border-left: 4px solid #FF6B00;
  border-radius: 0 8px 8px 0;
  padding: 10px 16px;
  margin-bottom: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pr300-needs-attention-text { color: #7a3b00; }
.pr300-needs-attention-action {
  font-size: 12px;
  font-weight: 600;
  color: #FF6B00;
  cursor: pointer;
  white-space: nowrap;
}

/* Mobile hide sidebar rule */
@media (max-width: 767px) {
  #pr300-root {
    left: 0;
  }
}

/* ─── Plans tab — PlanHub action block ─── */
.pr300-planhub-action {
  background: #f0f4ff;
  border: 1px solid #d0d9f0;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.pr300-planhub-desc {
  font-size: 13px;
  color: #444;
  margin: 0;
}
.pr300-planhub-btn {
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.pr300-planhub-btn:hover { background: #e05a00; }

/* ─── Doc items — clickable state ─── */
.pr300-doc-item-linked {
  cursor: pointer;
  transition: background 0.12s;
}
.pr300-doc-item-linked:hover {
  background: #f5f7fa;
}
.pr300-doc-item-linked:focus {
  outline: 2px solid #FF6B00;
  outline-offset: 1px;
}
.pr300-doc-arrow {
  font-size: 18px;
  color: #bbb;
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── Breadcrumb (hub view, replaces custom header) ─── */
.pr300-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #ebebeb;
  font-size: 13px;
}
.pr300-back-link {
  background: none;
  border: none;
  color: #FF6B00;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.pr300-back-link:hover { text-decoration: underline; }
.pr300-breadcrumb-sep { color: #bbb; }
.pr300-breadcrumb-current { color: #333; font-weight: 600; }

/* ── Per-doc download button ────────────────────────────────────────────── */
.pr300-doc-item {
  display: flex;
  align-items: center;
  gap: 0;
}
.pr300-doc-dl-btn {
  margin-left: auto;
  background: none;
  border: 1.5px solid #e0e0e0;
  border-radius: 5px;
  padding: 4px 7px;
  cursor: pointer;
  color: #888;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}
.pr300-doc-dl-btn:hover {
  border-color: #FF6B00;
  color: #FF6B00;
}

/* ── Download All row ───────────────────────────────────────────────────── */
.pr300-dl-all-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.pr300-dl-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1A1A2E;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.pr300-dl-all-btn:hover { background: #2e2e4e; }
.pr300-dl-all-btn svg { flex-shrink: 0; }

/* ── Download feedback toast ────────────────────────────────────────────── */
.pr300-dl-feedback {
  background: #e3f2fd;
  border-left: 3px solid #1565c0;
  color: #1565c0;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.5;
  animation: pr300-fadein 0.2s ease;
}
@keyframes pr300-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
