/* Imports Supply Chain — سلسلة توريد الاستيرادات */

.isc-rule-banner {
  padding: 12px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fef3c7, #fff7ed);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
}

.isc-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.isc-kpi {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.isc-kpi.warn { border-color: #fbbf24; background: #fffbeb; }
.isc-kpi.alert { border-color: #f87171; background: #fef2f2; }

.isc-kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: #1e3a5f;
}

.isc-kpi-lbl {
  font-size: 11px;
  color: var(--text-m, #6b7280);
  margin-top: 4px;
}

.isc-cost-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-m, #6b7280);
  padding: 8px 0;
}

.isc-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.isc-st-po_confirmed { background: #dbeafe; color: #1e40af; }
.isc-st-supplier_production { background: #e0e7ff; color: #3730a3; }
.isc-st-goods_ready { background: #d1fae5; color: #065f46; }
.isc-st-container_booking { background: #cffafe; color: #0e7490; }
.isc-st-loaded { background: #fef3c7; color: #b45309; }
.isc-st-departed_origin { background: #ffedd5; color: #c2410c; }
.isc-st-in_transit { background: #fde68a; color: #92400e; }
.isc-st-arrived_destination { background: #bbf7d0; color: #166534; }
.isc-st-customs_clearance { background: #fecaca; color: #991b1b; }
.isc-st-released { background: #a7f3d0; color: #047857; }
.isc-st-delivered_warehouse { background: #86efac; color: #14532d; }

.isc-auto-tag {
  font-size: 9px;
  background: #714B67;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
}

.isc-pipeline {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  padding: 8px 0 16px;
  margin-bottom: 8px;
}

.isc-pipe-step {
  flex: 0 0 auto;
  text-align: center;
  min-width: 72px;
  opacity: 0.45;
}

.isc-pipe-step.done, .isc-pipe-step.active { opacity: 1; }

.isc-pipe-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  margin: 0 auto 4px;
}

.isc-pipe-step.done .isc-pipe-dot { background: #22c55e; }
.isc-pipe-step.active .isc-pipe-dot { background: #714B67; box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.25); }

.isc-pipe-lbl {
  font-size: 9px;
  color: var(--text-m, #6b7280);
  line-height: 1.2;
}

.isc-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  margin: 8px 0;
}

.isc-section-title {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
}

.isc-landed {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f0fdf4;
  border-radius: 8px;
  font-size: 13px;
}

.isc-empty {
  text-align: center;
  color: var(--text-s, #9ca3af);
  padding: 16px;
  font-size: 12px;
}

.isc-row { cursor: pointer; }
.isc-row:hover { background: #f8fafc; }

.isc-port-wrap { position: relative; }

.isc-port-dropdown {
  position: absolute;
  z-index: 200;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  display: none;
}

.isc-port-item {
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}

.isc-port-item:hover { background: #f3f4f6; }
.isc-port-item.muted { color: #9ca3af; cursor: default; }

.isc-alert-item {
  padding: 8px 10px;
  border-bottom: 1px solid #fef3c7;
  font-size: 12px;
  cursor: pointer;
}

.isc-alert-item:hover { background: #fffbeb; }
.isc-alert-item.high { border-right: 3px solid #dc2626; }
.isc-alert-item.medium { border-right: 3px solid #f59e0b; }

.isc-map-container {
  height: 360px;
  width: 100%;
  background: #e5e7eb;
  border-radius: 0 0 8px 8px;
}

.isc-map-detail {
  height: 260px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
}

.isc-map-pin .isc-pin {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}

.isc-margin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.isc-margin-ok { color: #047857; }
.isc-margin-bad { color: #b91c1c; font-weight: 700; }

tr.isc-margin-ok td { background: #f0fdf4; }
tr.isc-margin-bad td { background: #fef2f2; }
