/**
 * PO (Potential Opportunity) / Opportunity Summary modal – matches Figma.
 * Utilization Score card (gradient blue–indigo), Status Breakdown rows with Lucide-style icons and colors, KEY INSIGHT card.
 */

.po-breakdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.po-breakdown-modal {
  position: relative;
  z-index: 50;
  width: 100%;
  max-width: 32rem; /* sm:max-w-lg */
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  gap: 1rem;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.po-breakdown-header-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.po-breakdown-header-text {
  padding-right: 2.5rem;
}

.po-breakdown-title {
  font-size: 1.125rem;
  line-height: 1.25;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.po-breakdown-subtitle {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0;
}

.po-breakdown-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  padding: 0.25rem;
  border: none;
  background: transparent;
  border-radius: 0.125rem;
  cursor: pointer;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
}

.po-breakdown-close:hover {
  opacity: 1;
}

.po-breakdown-close svg {
  width: 1rem;
  height: 1rem;
}

.po-breakdown-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Utilization Score card: gradient from blue-50 to indigo-50, border blue-100 */
.po-util-card {
  background: linear-gradient(to bottom right, #eff6ff, #eef2ff);
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.po-util-label {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.25rem;
}

.po-util-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 0.5rem;
}

.po-util-engaged {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0;
}

/* Status Breakdown section */
.po-breakdown-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.po-breakdown-section-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.po-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Status row: flex items-center justify-between p-3 rounded-lg bg-{color}-50 border border-{color}-600/20 */
.po-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.po-status-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.po-status-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.po-status-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.po-status-pct {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.125rem;
}

.po-status-count {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

/* Converted: green */
.po-status-converted {
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, 0.2);
}

.po-status-icon.po-status-converted {
  color: #16a34a;
}

/* Attempted: blue */
.po-status-attempted {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.2);
}

.po-status-icon.po-status-attempted {
  color: #2563eb;
}

/* Pending: yellow */
.po-status-pending {
  background: #fefce8;
  border-color: rgba(202, 138, 4, 0.2);
}

.po-status-icon.po-status-pending {
  color: #ca8a04;
}

/* Not Converted: orange */
.po-status-not-converted {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.2);
}

.po-status-icon.po-status-not-converted {
  color: #ea580c;
}

/* Ignored: gray */
.po-status-ignored {
  background: #f9fafb;
  border-color: rgba(75, 85, 99, 0.2);
}

.po-status-icon.po-status-ignored {
  color: #4b5563;
}

/* KEY INSIGHT card: bg-amber-50 border-amber-200, left bar amber-400 */
.po-insight-card {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  padding: 1rem;
}

.po-insight-bar {
  width: 4px;
  min-height: 2.5rem;
  background: #fbbf24;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 2px;
}

.po-insight-body {
  flex: 1;
  min-width: 0;
}

.po-insight-heading {
  font-size: 0.75rem;
  font-weight: 500;
  color: #92400e;
  margin-bottom: 0.25rem;
}

.po-insight-text {
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.4;
  margin: 0;
}

/* Clickable PO cell in table */
.practice-table-po-cell {
  cursor: pointer;
}

.practice-table-po-cell:hover {
  text-decoration: underline;
}

.po-breakdown-loading {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

.po-breakdown-error {
  padding: 1.5rem;
  color: #dc2626;
  font-size: 0.875rem;
}
