/* ============================================================
   TradeRail — PR385 Submittal Engine Styles
   Build marker: PR385 Submittal Engine 2026-06-21
   Brand: Primary Orange #FF6B00 | Dark #1A1A2E
   ============================================================ */

/* === Reset / Base === */
.pr385-insight-bar,
.pr385-catalog-card,
.pr385-package-card,
.pr385-tracking-row,
.pr385-bypass-form,
.pr385-quickadd-panel,
.pr385-filter-bar,
.pr385-sm-header {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1A1A2E;
}

/* === TRai Insight Bar === */
.pr385-insight-bar {
  background: #fff8f3;
  border-left: 4px solid #FF6B00;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.pr385-insight-heading {
  font-weight: 700;
  font-size: 13px;
  color: #FF6B00;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.pr385-insight-item {
  display: block;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  color: #1A1A2E;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pr385-insight-item:hover {
  background: #ffe8d6;
}

.pr385-insight-item.pr385-insight-info {
  background: #f0f4ff;
  border-left: 3px solid #4a90d9;
}

.pr385-insight-item.pr385-insight-warning {
  background: #fff8e1;
  border-left: 3px solid #FF6B00;
}

.pr385-insight-item.pr385-insight-urgent {
  background: #fff0f0;
  border-left: 3px solid #d94a4a;
}

.pr385-insight-item.pr385-insight-critical {
  background: #ffeaea;
  border-left: 3px solid #a10000;
  font-weight: 600;
}

.pr385-insight-empty {
  color: #888;
  font-size: 13px;
  font-style: italic;
}

/* === Submittal Manager === */
.pr385-sm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #FF6B00;
}

.pr385-sm-title {
  font-size: 20px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0;
}

/* === Filter Bar === */
.pr385-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pr385-filter-select {
  padding: 6px 10px;
  border: 1px solid #d0d0d8;
  border-radius: 4px;
  font-size: 13px;
  color: #1A1A2E;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.pr385-filter-select:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.2);
}

/* === Package / Catalog Cards === */
.pr385-package-card,
.pr385-catalog-card {
  background: #fff;
  border: 1px solid #e0e0ea;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06);
  transition: box-shadow 0.15s ease;
}

.pr385-package-card:hover,
.pr385-catalog-card:hover {
  box-shadow: 0 3px 8px rgba(26, 26, 46, 0.12);
}

.pr385-package-spec,
.pr385-catalog-manufacturer {
  font-weight: 600;
  font-size: 14px;
  color: #1A1A2E;
}

.pr385-catalog-model {
  font-size: 12px;
  color: #666;
  margin-left: 4px;
}

.pr385-catalog-category {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pr385-catalog-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* === Status Badges === */
.pr385-status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pr385-status-pending {
  background: #fff3e0;
  color: #e65100;
}

.pr385-status-approved {
  background: #e8f5e9;
  color: #2e7d32;
}

.pr385-status-approved_as_noted {
  background: #e1f5fe;
  color: #0277bd;
}

.pr385-status-revise_resubmit {
  background: #fff8e1;
  color: #f57f17;
}

.pr385-status-rejected {
  background: #fce4ec;
  color: #c62828;
}

.pr385-status-not_started {
  background: #f5f5f5;
  color: #616161;
}

.pr385-status-draft {
  background: #ede7f6;
  color: #4527a0;
}

/* === TRai Confidence Badges === */
.pr385-confidence {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.pr385-confidence-high {
  background: #e8f5e9;
  color: #2e7d32;
}

.pr385-confidence-medium {
  background: #fff8e1;
  color: #e65100;
}

.pr385-confidence-low {
  background: #fce4ec;
  color: #c62828;
}

.pr385-confidence-manual {
  background: #eceff1;
  color: #455a64;
}

/* === Procurement Lock Badges === */
.pr385-lock-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pr385-lock-locked {
  background: #fce4ec;
  color: #c62828;
}

.pr385-lock-unlocked {
  background: #e8f5e9;
  color: #2e7d32;
}

.pr385-lock-bypassed {
  background: #fff8e1;
  color: #e65100;
}

/* === OFE Badges === */
.pr385-ofe-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e3f2fd;
  color: #0d47a1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pr385-ofe-status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.pr385-ofe-status-pending {
  background: #fff3e0;
  color: #e65100;
}

.pr385-ofe-status-delivered {
  background: #e8f5e9;
  color: #2e7d32;
}

.pr385-ofe-status-overdue {
  background: #fce4ec;
  color: #c62828;
}

.pr385-ofe-status-stored {
  background: #e1f5fe;
  color: #0277bd;
}

/* === Long-Lead Badge === */
.pr385-long-lead-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fce4ec;
  color: #880e4f;
  font-size: 11px;
  font-weight: 600;
}

/* === Preferred Vendor Badge (PR381) === */
.pr385-preferred-vendor-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #FF6B00;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* === Buttons === */
.pr385-btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, opacity 0.15s ease;
  outline: none;
}

.pr385-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.4);
}

.pr385-btn-primary {
  background: #FF6B00;
  color: #fff;
}

.pr385-btn-primary:hover {
  background: #e05e00;
}

.pr385-btn-secondary {
  background: #1A1A2E;
  color: #fff;
}

.pr385-btn-secondary:hover {
  background: #2c2c4a;
}

.pr385-btn-danger {
  background: #fce4ec;
  color: #c62828;
  border: 1px solid #e57373;
}

.pr385-btn-danger:hover {
  background: #f8bbd0;
}

.pr385-btn-danger[data-confirm-armed] {
  background: #c62828;
  color: #fff;
  border-color: #c62828;
}

/* === Catalog Unit Cost (Owner/Admin only — never shown to Field Tech/Foreman) === */
.pr385-catalog-unit-cost {
  font-size: 12px;
  color: #888;
  border-top: 1px solid #f0f0f4;
  padding-top: 6px;
  margin-top: 2px;
}

/* === Bypass Form === */
.pr385-bypass-form {
  background: #fff8f3;
  border: 1px solid #FF6B00;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 12px;
}

.pr385-bypass-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 6px;
}

.pr385-bypass-reason {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid #d0d0d8;
  border-radius: 4px;
  font-size: 13px;
  color: #1A1A2E;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 10px;
  outline: none;
}

.pr385-bypass-reason:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.2);
}

/* === Post-Submission Tracking === */
.pr385-tracking-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: #fff;
  border: 1px solid #e0e0ea;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.pr385-tracking-field {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.pr385-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin-bottom: 2px;
}

.pr385-field-value {
  font-size: 14px;
  color: #1A1A2E;
  font-weight: 500;
}

/* === Quick-Add Panel (slide-in) === */
.pr385-quickadd-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 380px;
  background: #fff;
  box-shadow: -4px 0 24px rgba(26, 26, 46, 0.18);
  border-left: 4px solid #FF6B00;
  padding: 24px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.pr385-quickadd-panel[data-open] {
  display: block;
}

.pr385-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 16px;
  border-bottom: 2px solid #FF6B00;
  padding-bottom: 10px;
}

/* === Empty State === */
.pr385-empty {
  text-align: center;
  color: #aaa;
  padding: 32px 0;
  font-size: 13px;
  font-style: italic;
}

/* === Package List === */
.pr385-package-list {
  display: flex;
  flex-direction: column;
}

/* === Responsive === */
@media (max-width: 600px) {
  .pr385-filter-bar {
    flex-direction: column;
  }

  .pr385-quickadd-panel {
    width: 100%;
    right: 0;
    left: 0;
  }

  .pr385-sm-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
