/* ============================================================
   Supplier dashboard — kanban + insights
   ============================================================ */

.sd-main { padding: 28px 0 80px; }

.sd-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.sd-head h1 {
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1;
  font-family: var(--font);
  font-weight: 600;
}
.sd-head .greet {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ===== KPI ===== */
.sd-kpi {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

/* ===== KANBAN ===== */
.sd-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 480px;
}
.kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.kanban-head h3 {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kanban-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-head .count {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
}
.kanban-head.urgent { background: var(--wait-soft); }
.kanban-head.urgent .count { background: var(--wait); color: white; }
.kanban-head.urgent h3 { color: var(--wait); }

.kanban-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}
.kanban-card:hover { border-color: var(--text); transform: translateY(-1px); }
.kanban-card.urgent { border-color: var(--wait); }
.kanban-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.kanban-card .top .id { font-weight: 600; color: var(--text); }
.kanban-card .n { font-size: 13px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; margin-top: 4px; }
.kanban-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
}
.kanban-card .meta .when { color: var(--text-muted); }
.kanban-card .meta .amount {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text);
}
.kanban-card .timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: var(--wait);
  color: white;
}
.kanban-card .timer-pill .ms { font-size: 11px; }

.kanban-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-muted);
  font-size: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}
.kanban-empty .ms { display: block; font-size: 24px; margin-bottom: 6px; color: var(--text-faint); }

/* ===== TWO COL: products + alerts ===== */
.sd-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

/* top products */
.top-products { display: flex; flex-direction: column; gap: 0; }
.top-row {
  display: grid;
  grid-template-columns: 30px 36px 1fr 80px 110px 100px;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.top-row:last-child { border-bottom: 0; }
.top-row .rank {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
}
.top-row.gold .rank { color: var(--signal); }
.top-row.gold .rank::before { content: '★ '; }

.top-row .ic {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  display: grid; place-items: center;
}
.top-row .ic .ms { font-size: 18px; color: var(--text); }

.top-row .info .n {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.top-row .info .d {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.top-row .qty {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.top-row .revenue {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.top-row .spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}
.top-row .spark span {
  flex: 1;
  background: var(--dark);
  border-radius: 1px;
}
.top-row.up .spark span { background: var(--go); }
.top-row.down .spark span { background: var(--busy); opacity: 0.6; }

/* alerts */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.alert-row.danger { background: var(--busy-soft); border-color: rgba(185, 28, 28, 0.2); }
.alert-row.warn { background: var(--wait-soft); border-color: rgba(180, 83, 9, 0.2); }
.alert-row .ic {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.alert-row.danger .ic { background: var(--busy); color: white; border-color: var(--busy); }
.alert-row.warn .ic { background: var(--wait); color: white; border-color: var(--wait); }
.alert-row .info .n { font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.alert-row .info .d {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
}
.alert-row .info .d.danger { color: var(--busy); }
.alert-row .info .d.warn { color: var(--wait); }
.alert-row .stock {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}
.alert-row .stock.danger { color: var(--busy); }
.alert-row .stock.warn { color: var(--wait); }
