/* ═══════════════════════════════════════════════════════════════
   ACTION CENTER — Page-Specific Styles
   Inherits from styles.css design system
   ═══════════════════════════════════════════════════════════════ */

/* ── KPI Summary Strip ── */
.action-kpi-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.action-kpi {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s, box-shadow 0.2s;
}

.action-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-kpi-icon i { width: 20px; height: 20px; }

.action-kpi-icon.critical { background: var(--danger-100); color: var(--danger-600); }
.action-kpi-icon.high     { background: var(--warning-100); color: var(--warning-600); }
.action-kpi-icon.medium   { background: var(--info-100); color: var(--info-500); }
.action-kpi-icon.savings  { background: var(--success-100); color: var(--success-600); }
.action-kpi-icon.network  { background: #ede9fe; color: #7c3aed; }

.action-kpi-content {
  display: flex;
  flex-direction: column;
}

.action-kpi-value {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.action-kpi-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Action Table Row States ── */
.action-row {
  cursor: pointer;
  transition: background-color 0.15s;
}

.action-row:hover {
  background-color: var(--primary-50) !important;
}

.action-row.row-approved {
  opacity: 0.55;
}

.action-row.row-blocked {
  background: var(--danger-50) !important;
  opacity: 0.75;
}

.expand-toggle {
  width: 30px;
  text-align: center;
}

.expand-icon {
  width: 14px;
  height: 14px;
  color: var(--text-light);
  transition: transform 0.2s;
}

/* ── Priority Badges ── */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.225rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.priority-badge i { width: 12px; height: 12px; }

.priority-critical { background: var(--danger-100); color: var(--danger-600); }
.priority-high     { background: var(--warning-100); color: var(--warning-600); }
.priority-medium   { background: var(--info-100);   color: var(--info-500); }

/* ── Fulfillment Type Badges ── */
.badge-dc    { background: var(--success-100); color: var(--success-700); }
.badge-sto   { background: var(--info-100);    color: var(--info-700); }
.badge-po    { background: var(--warning-100); color: var(--warning-700); }
.badge-split { background: #ede9fe;            color: #5b21b6; }

.badge-dc i, .badge-sto i, .badge-po i, .badge-split i {
  width: 12px;
  height: 12px;
}

/* ── Coverage Badge ── */
.coverage-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.coverage-critical { background: var(--danger-100);  color: var(--danger-700); }
.coverage-low      { background: var(--warning-100); color: var(--warning-700); }
.coverage-medium   { background: var(--primary-100); color: var(--primary-800); }
.coverage-ok       { background: var(--success-100); color: var(--success-700); }

/* ── Lead Time ── */
.lead-time {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   EXPANDABLE DETAIL PANEL
   ═══════════════════════════════════════════════════════════════ */

.detail-row td {
  padding: 0 !important;
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--primary-500) !important;
}

.detail-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.detail-section {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.125rem;
  box-shadow: var(--shadow-xs);
}

.detail-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-section-header i { width: 16px; height: 16px; }
.detail-section-header h4 { font-size: 0.8125rem; font-weight: 700; }
.detail-section-header .text-muted { font-weight: 500; }

.vendor-section {
  grid-column: span 2;
}

/* ── Source Comparison Tables ── */
.source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.source-table th {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  font-weight: 700;
  padding: 0.5rem 0.625rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  background: none;
}

.source-table td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.source-table tbody tr:last-child td { border-bottom: none; }
.source-table tbody tr:hover { background-color: var(--bg-subtle); }

.source-name {
  font-weight: 600;
  color: var(--text-main);
}

.source-recommended {
  background: linear-gradient(90deg, var(--success-50) 0%, white 100%) !important;
  border-left: 3px solid var(--success-500);
}

/* ── Split Fulfillment Notice ── */
.split-notice {
  grid-column: span 2;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
  border: 1px solid #c4b5fd;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: #5b21b6;
}

.split-notice i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE (Actions page)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .detail-panel {
    grid-template-columns: 1fr;
  }
  .vendor-section, .split-notice {
    grid-column: span 1;
  }
  .action-kpi-strip {
    flex-wrap: wrap;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .action-kpi-strip {
    gap: 0.5rem;
  }
  .kpi-box {
    min-width: 0;
    padding: 0.75rem;
    flex: 1 1 calc(50% - 0.5rem);
  }
  .kpi-box .kpi-value { font-size: 1.25rem; }
  .kpi-box .kpi-label { font-size: 0.65rem; }

  .action-table {
    font-size: 0.75rem;
  }
  .action-table th,
  .action-table td {
    padding: 0.5rem 0.4rem;
  }

  .table-filters {
    flex-direction: column;
    gap: 0.5rem;
  }
  .table-filters select,
  .table-filters input {
    width: 100%;
  }

  .detail-panel {
    padding: 0.75rem;
  }

  .action-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .kpi-box {
    flex: 1 1 100%;
  }
  .page-header h2 { font-size: 1.25rem; }
  .action-table { font-size: 0.7rem; }
}
