/* ============================================================
   PR342 — Lily Vendor Intelligence
   TradeRail Field Portal
   Build: pr342-vendor-intelligence:2026-06-19
   No emoji. Tenant-neutral.
============================================================ */

/* ── Lily Advisory Bar ────────────────────────────────────────────────────── */
.pr342-lily-bar {
  border-left: 4px solid #7C3AED;
  background: #F5F3FF;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #3B1F7A;
  line-height: 1.6;
}

.pr342-lily-label {
  font-weight: 700;
  color: #7C3AED;
  margin-right: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Scorecard Container ──────────────────────────────────────────────────── */
.pr342-scorecard-container {
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  color: #1A1A2E;
}

/* ── Filter Bar ───────────────────────────────────────────────────────────── */
.pr342-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #F8F9FA;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  align-items: center;
}

.pr342-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #4A5568;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pr342-filter-select {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #CBD5E0;
  border-radius: 4px;
  background: #FFF;
  color: #2D3748;
  cursor: pointer;
}

.pr342-filter-select:focus {
  outline: 2px solid #7C3AED;
  outline-offset: 1px;
}

/* ── Scorecard Table ──────────────────────────────────────────────────────── */
.pr342-scorecard-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  overflow: hidden;
}

.pr342-th {
  background: #F7F9FC;
  border-bottom: 2px solid #E2E8F0;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4A5568;
  white-space: nowrap;
}

.pr342-td {
  padding: 10px 12px;
  border-bottom: 1px solid #EEF0F4;
  vertical-align: middle;
  font-size: 13px;
  color: #2D3748;
}

.pr342-vendor-row:hover .pr342-td {
  background: #F7F9FD;
}

.pr342-vendor-row:last-child .pr342-td {
  border-bottom: none;
}

/* ── Reliability Badges ───────────────────────────────────────────────────── */
/* Green: #437A22 */
.pr342-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pr342-badge-green {
  background: #DFFADE;
  color: #437A22;
  border: 1px solid #437A22;
}

/* Yellow: #964219 */
.pr342-badge-yellow {
  background: #FEF3E2;
  color: #964219;
  border: 1px solid #964219;
}

/* Red: #A12C7B */
.pr342-badge-red {
  background: #FCE8F4;
  color: #A12C7B;
  border: 1px solid #A12C7B;
}

/* Gray: insufficient data */
.pr342-badge-gray {
  background: #F0F0F0;
  color: #718096;
  border: 1px solid #A0AEC0;
}

/* ── Price Trend Arrows ───────────────────────────────────────────────────── */
.pr342-trend {
  font-size: 14px;
  font-weight: 700;
}

.pr342-trend-up {
  color: #C0392B;
}

.pr342-trend-down {
  color: #437A22;
}

.pr342-trend-flat {
  color: #718096;
}

/* ── COI Status Badges ────────────────────────────────────────────────────── */
.pr342-coi-current {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #DFFADE;
  color: #276749;
  border: 1px solid #48BB78;
}

.pr342-coi-expiring {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #FEF3E2;
  color: #C05621;
  border: 1px solid #ED8936;
}

.pr342-coi-expired {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #FCE8E8;
  color: #9B2C2C;
  border: 1px solid #FC8181;
}

/* ── Action Buttons ───────────────────────────────────────────────────────── */
.pr342-btn {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.pr342-btn-detail {
  background: #EFF3FB;
  color: #3B5BDB;
  border-color: #3B5BDB;
}

.pr342-btn-detail:hover {
  background: #3B5BDB;
  color: #FFF;
}

/* ── Overlay & Detail Panel ───────────────────────────────────────────────── */
.pr342-overlay {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: #FFF;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 9000;
  overflow-y: auto;
  transition: right 0.3s ease;
}

.pr342-overlay-active {
  right: 0;
}

.pr342-detail-panel {
  padding: 24px 20px;
}

.pr342-panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid #CBD5E0;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #4A5568;
}

.pr342-panel-close:hover {
  background: #F0F0F0;
}

.pr342-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 20px 0;
  padding-right: 80px;
}

.pr342-panel-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #E2E8F0;
}

.pr342-panel-section:last-child {
  border-bottom: none;
}

.pr342-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4A5568;
  margin: 0 0 10px 0;
}

.pr342-no-data {
  color: #A0AEC0;
  font-style: italic;
  font-size: 12px;
}

/* ── Price History Chart / Table ──────────────────────────────────────────── */
.pr342-price-chart-label {
  font-size: 12px;
  font-weight: 600;
  color: #2D3748;
  margin-bottom: 6px;
  margin-top: 8px;
}

.pr342-price-chart {
  margin-bottom: 12px;
}

.pr342-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pr342-price-table th {
  background: #F7F9FC;
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  color: #4A5568;
  border-bottom: 1px solid #E2E8F0;
}

.pr342-price-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #EEF0F4;
  color: #2D3748;
}

.pr342-price-avg-line {
  color: #7C3AED;
  font-size: 11px;
  font-style: italic;
  margin-top: 4px;
}

/* ── Delivery Summary ─────────────────────────────────────────────────────── */
.pr342-delivery-summary {
  font-size: 13px;
  color: #2D3748;
  margin: 0;
}

/* ── Jobs List ────────────────────────────────────────────────────────────── */
.pr342-jobs-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
}

.pr342-jobs-list li {
  padding: 3px 0;
  font-size: 12px;
}

.pr342-link {
  color: #3B5BDB;
  text-decoration: none;
  font-size: 12px;
}

.pr342-link:hover {
  text-decoration: underline;
}

/* ── Lily Insights Panel ──────────────────────────────────────────────────── */
.pr342-lily-insights {
  background: #F5F3FF;
  border-left: 3px solid #7C3AED;
  padding-left: 14px;
  border-radius: 0 4px 4px 0;
}

.pr342-lily-insights p {
  margin: 4px 0;
  font-size: 12px;
  color: #3B1F7A;
}

.pr342-lily-reason {
  color: #5A3E8A;
  font-style: italic;
  margin-top: 6px;
}

/* ── Alternate Vendors ────────────────────────────────────────────────────── */
.pr342-alternates {
  margin-top: 10px;
  font-size: 12px;
}

.pr342-alternates strong {
  color: #2D3748;
  display: block;
  margin-bottom: 4px;
}

.pr342-alternates ul {
  list-style: disc;
  padding-left: 16px;
  margin: 0;
}

.pr342-alternates li {
  padding: 3px 0;
  color: #3B1F7A;
  line-height: 1.5;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pr342-overlay {
    width: 100vw;
    right: -100vw;
  }

  .pr342-overlay-active {
    right: 0;
  }

  .pr342-scorecard-table {
    display: block;
    overflow-x: auto;
  }

  .pr342-filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
