/* ================================================================
   25_parallel_import_offcanvas.css
   Parallel Import — Review Workspace (split-view redesign)
   ================================================================ */


/* ================================================================
   A. SPLIT-VIEW LAYOUT
   ================================================================ */

.pi-ws-split-view {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 160px);
  position: relative;
}

/* Table panel (left side) */
.pi-ws-table-panel {
  flex: 1 1 auto;
  min-width: 0;
  transition: flex 0.25s ease;
  overflow: hidden;
}

/* When workspace is open, table shrinks */
.pi-ws-split-view .pi-ws-table-panel {
  flex: 0 0 38%;
  max-width: 38%;
}

/* When workspace is closed, table gets full width */
.pi-ws-table-full {
  flex: 1 1 100% !important;
  max-width: 100% !important;
}

/* Expanded mode: table even narrower */
.pi-ws-expanded .pi-ws-table-panel {
  flex: 0 0 12% !important;
  max-width: 12% !important;
  overflow: hidden;
}

/* Review workspace (right side) */
.pi-ws-workspace {
  flex: 0 0 clamp(880px, 62vw, 1120px);
  max-width: clamp(880px, 62vw, 1120px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
  height: calc(100vh - 160px);
  position: sticky;
  top: 0;
  overflow: hidden;
  transition: flex 0.25s ease, max-width 0.25s ease;
}

/* Expanded workspace */
.pi-ws-expanded .pi-ws-workspace {
  flex: 0 0 min(90vw, 1440px) !important;
  max-width: min(90vw, 1440px) !important;
}


/* ================================================================
   B. WORKSPACE INTERNAL LAYOUT
   ================================================================ */

/* Sticky header (reuses existing pi-oc- classes) */
.pi-oc-sticky-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  padding: 12px 24px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.pi-oc-close-btn {
  color: #64748b !important;
  padding: 4px 6px !important;
  line-height: 1 !important;
  font-size: 16px !important;
  border: none !important;
  text-decoration: none !important;
}
.pi-oc-close-btn:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
  border-radius: 4px !important;
}

/* Prev/next navigation buttons */
.pi-oc-nav-btn {
  padding: 2px 6px !important;
  font-size: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #64748b !important;
  line-height: 1 !important;
}
.pi-oc-nav-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.pi-oc-nav-pos {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}


/* ── Workflow tab navigation ──────────────────────────────────── */
.pi-ws-tab-nav {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  z-index: 5;
}

.pi-ws-workflow-tabs .nav-link {
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  color: #64748b !important;
  padding: 10px 12px !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  white-space: nowrap;
}
.pi-ws-workflow-tabs .nav-link:hover {
  color: #0f172a !important;
  border-bottom-color: #e2e8f0 !important;
}
.pi-ws-workflow-tabs .nav-link.active {
  color: #0066cc !important;
  border-bottom-color: #0066cc !important;
  background: transparent !important;
}


/* ── Content layout (main + rail) ─────────────────────────────── */
.pi-ws-content-layout {
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
}

.pi-ws-main-content {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 32px;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.pi-ws-decision-rail-wrap {
  flex: 0 0 280px;
  width: 280px;
  overflow-y: auto;
  padding: 16px;
  border-left: 1px solid #e2e8f0;
  background: #fafbfc;
  -webkit-overflow-scrolling: touch;
}


/* ================================================================
   C. DECISION RAIL
   ================================================================ */

.pi-ws-decision-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pi-ws-rail-rec {
  padding: 10px 12px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.pi-ws-rail-metric {
  padding: 4px 0;
}


/* ================================================================
   D. TAB CONTENT — SHARED
   ================================================================ */

.pi-ws-tab-content {
  max-width: 100%;
}


/* ── Summary strip (KPI) ──────────────────────────────────────── */
.pi-oc-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 0 20px;
}

.pi-oc-metric {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 0;
}

.pi-oc-metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #64748b;
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-oc-metric-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-oc-metric-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}


/* ── Section titles ───────────────────────────────────────────── */
.pi-oc-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #374151;
  margin-bottom: 8px;
}
.pi-oc-section-title--caution {
  color: #92400e;
}


/* ── Why this ranks / driver bullets ──────────────────────────── */
.pi-oc-why-ranks {
  padding: 0 0 16px;
}

.pi-oc-driver-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pi-oc-driver-item {
  font-size: 13px;
  line-height: 1.5;
  padding: 2px 0 2px 20px;
  position: relative;
  color: #374151;
}
.pi-oc-driver-item::before {
  position: absolute;
  left: 0;
  font-size: 12px;
}

.pi-oc-driver-pos::before {
  content: "\2713";
  color: #28a745;
}
.pi-oc-driver-cau::before {
  content: "\26A0";
  color: #e57c00;
  font-size: 11px;
}


/* ── Score breakdown (compact) ────────────────────────────────── */
.pi-oc-score-compact {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
}


/* ── Two-column layout (score + ops) ──────────────────────────── */
.pi-oc-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}


/* ── Operational review ───────────────────────────────────────── */
.pi-oc-ops-review {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
}


/* ── Product fit summary ──────────────────────────────────────── */
.pi-oc-product-fit {
  margin-bottom: 16px;
}

.pi-oc-fit-grid {
  display: flex;
  flex-direction: column;
}

.pi-oc-fit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.pi-oc-fit-row:last-child {
  border-bottom: none;
}

.pi-oc-fit-label {
  color: #64748b;
  font-size: 12px;
}

.pi-oc-fit-status {
  font-size: 12px;
  font-weight: 600;
}


/* ── Evidence summary ─────────────────────────────────────────── */
.pi-oc-evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.pi-oc-evidence-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
}


/* ── Collapsible (full comparison) ────────────────────────────── */
.pi-oc-collapsible {
  margin-bottom: 16px;
}

.pi-oc-expand-trigger {
  font-size: 12px;
  font-weight: 600;
  color: #0066cc;
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
}
.pi-oc-expand-trigger::-webkit-details-marker {
  display: none;
}
.pi-oc-expand-trigger::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  transition: transform 0.15s;
}
details[open] > .pi-oc-expand-trigger::before {
  transform: rotate(90deg);
}


/* ── Comparison matrix ─────────────────────────────────────────── */
.pi-oc-matrix {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.pi-oc-mx-row {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  min-height: 34px;
}
.pi-oc-mx-row:last-child {
  border-bottom: none;
}

.pi-oc-mx-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  min-height: 36px;
}

.pi-oc-mx-cell {
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-oc-mx-attr {
  font-size: 11px;
  font-weight: 500;
}

.pi-oc-mx-val {
  font-variant-numeric: tabular-nums;
}

.pi-oc-mx-status {
  text-align: center;
}

.pi-oc-mx-row:nth-child(even):not(.pi-oc-mx-header) {
  background: #fafbfc;
}

.pi-oc-badge {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  letter-spacing: 0.2px;
}


/* ── Tab bar (used inside Market) ──────────────────────────────── */
.pi-oc-tabbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  margin: 0 -24px;
  padding: 0 24px;
  border-bottom: 1px solid #e2e8f0;
}

.pi-oc-tab-content {
  padding-top: 12px;
  min-height: 200px;
}


/* ── Empty / Error / Loading states ────────────────────────────── */
.pi-oc-empty-state,
.pi-oc-error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-size: 13px;
  color: #64748b;
  border: 1px dashed #e2e8f0;
  border-radius: 6px;
  margin: 8px 0;
}

.pi-oc-error-state {
  color: #d55e00;
  border-color: #fecaca;
  background: #fef2f2;
}


/* ================================================================
   E. OVERVIEW TAB — CHECKPOINT CARDS
   ================================================================ */

.pi-ws-checkpoints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.pi-ws-checkpoint {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 14px;
}


/* ================================================================
   F. ELIGIBILITY TAB
   ================================================================ */

.pi-ws-elig-summary {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 16px;
}

.pi-ws-diff-item {
  padding: 6px 0;
}


/* ================================================================
   G. COMMERCIAL CASE TAB
   ================================================================ */

.pi-ws-waterfall {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.pi-ws-waterfall-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.pi-ws-waterfall-row:last-child {
  border-bottom: none;
}

.pi-ws-waterfall-placeholder {
  background: #fafbfc;
}

.pi-ws-waterfall-total {
  background: #f0f9ff;
  border-top: 2px solid #e2e8f0;
}

.pi-ws-scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pi-ws-scenario-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px;
}


/* ================================================================
   H. MARKET TAB
   ================================================================ */

.pi-ws-market-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.pi-ws-market-module {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
}


/* ================================================================
   I. LAUNCH & RISK TAB
   ================================================================ */

.pi-ws-risk-summary {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.pi-ws-risk-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pi-ws-risk-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
}


/* ================================================================
   J. DECISION TAB
   ================================================================ */

.pi-ws-decision-rec {
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.pi-ws-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pi-ws-action-item {
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pi-ws-action-item:hover {
  background: #f0f9ff;
  border-color: #0066cc;
}


/* ================================================================
   K. RESPONSIVE
   ================================================================ */

/* Large desktop: comfortable split */
@media (min-width: 1600px) {
  .pi-ws-split-view .pi-ws-table-panel {
    flex: 0 0 42%;
    max-width: 42%;
  }
}

/* Laptop: workspace shrinks */
@media (max-width: 1280px) {
  .pi-ws-workspace {
    flex: 0 0 min(94vw, 720px) !important;
    max-width: min(94vw, 720px) !important;
  }

  .pi-ws-decision-rail-wrap {
    flex: 0 0 240px;
    width: 240px;
  }

  .pi-ws-split-view .pi-ws-table-panel {
    flex: 0 0 30%;
    max-width: 30%;
  }

  .pi-oc-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .pi-ws-checkpoints {
    grid-template-columns: 1fr;
  }

  .pi-ws-scenarios {
    grid-template-columns: 1fr;
  }

  .pi-ws-market-modules {
    grid-template-columns: 1fr;
  }
}

/* Tablet: workspace takes over */
@media (max-width: 1024px) {
  .pi-ws-split-view .pi-ws-table-panel {
    flex: 0 0 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
  }

  .pi-ws-workspace {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  .pi-ws-decision-rail-wrap {
    flex: 0 0 220px;
    width: 220px;
  }

  .pi-oc-sticky-header {
    padding: 10px 16px 8px;
  }

  .pi-ws-main-content {
    padding: 16px;
  }
}

/* Mobile: full-screen workspace, rail stacks below */
@media (max-width: 768px) {
  .pi-ws-content-layout {
    flex-direction: column;
  }

  .pi-ws-decision-rail-wrap {
    flex: 0 0 auto;
    width: 100%;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    padding: 12px 16px;
  }

  .pi-ws-main-content {
    padding: 12px 16px 16px;
  }

  .pi-oc-summary-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .pi-oc-metric-value {
    font-size: 14px;
  }

  .pi-oc-two-col {
    grid-template-columns: 1fr;
  }

  .pi-oc-evidence-grid {
    grid-template-columns: 1fr;
  }

  .pi-ws-checkpoints {
    grid-template-columns: 1fr;
  }

  .pi-ws-scenarios {
    grid-template-columns: 1fr;
  }

  .pi-ws-market-modules {
    grid-template-columns: 1fr;
  }

  .pi-oc-mx-row {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .pi-oc-mx-header {
    display: none;
  }

  .pi-oc-mx-row:not(.pi-oc-mx-header) {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 2px;
    border-bottom: 1px solid #e2e8f0;
  }

  .pi-oc-mx-attr {
    width: 100%;
    font-weight: 600;
    color: #0f172a !important;
    padding: 0;
    margin-bottom: 2px;
  }

  .pi-oc-mx-val {
    flex: 1;
    padding: 0 4px 0 0;
  }

  /* Workflow tabs scrollable */
  .pi-ws-tab-nav {
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pi-ws-workflow-tabs {
    flex-wrap: nowrap !important;
    white-space: nowrap;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .pi-oc-summary-strip {
    grid-template-columns: 1fr;
  }
}


/* ================================================================
   L. PAGE-LEVEL STYLES
   ================================================================ */

.pi-filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.pi-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
  color: #6c757d;
}
.pi-empty-state i {
  font-size: 2rem;
  opacity: 0.4;
}

.pi-toolbar-toggles .form-check-label {
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

@keyframes pi-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
