/* ============================================================
   产品管理模块样式
   ============================================================ */

/* 供应商来源徽标（供应商录入并同步到总部的产品） */
.prod-supplier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1.6;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  white-space: nowrap;
}
.prod-supplier-badge .psb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
}


/* 筛选栏 */
.products-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.products-filter .form-input {
  min-width: 150px;
  flex: 0 1 auto;
}

/* 毛利 */
.margin-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  font-weight: 600;
}
.margin-cell .margin-pct {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}
.margin-pos { color: #16a34a; }
.margin-neg { color: #dc2626; }

/* 多中心小标记 */
.muted-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 8px;
  font-weight: 500;
}

/* 弹窗内合作中心供货价 */
.form-section {
  margin-top: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fafbfc;
}
.form-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  color: #334155;
}
.price-rows { display: flex; flex-direction: column; gap: 8px; }
.price-row {
  display: grid;
  grid-template-columns: 1fr 140px 90px 40px;
  gap: 8px;
  align-items: center;
}
.price-row .form-input { width: 100%; }
.price-row-head {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  padding-bottom: 2px;
}
.price-row-head .ph-small { text-align: center; }
.price-primary-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}
.price-remove { padding: 6px 8px; }

/* 暗色主题适配 */
.dark .form-section { background: #1e293b; border-color: #334155; }
.dark .form-section-head { color: #e2e8f0; }
.dark .muted-tag { background: #334155; color: #cbd5e1; }

/* ===== 服务管理：产品项目行 ===== */
.service-items { gap: 8px; }
.service-item-row {
  display: grid;
  grid-template-columns: 90px 150px 1fr 140px 1fr 90px 1fr 40px;
  gap: 8px;
  align-items: center;
}
.service-item-row .form-input { width: 100%; min-width: 0; }
.service-item-head {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  padding-bottom: 2px;
}
.service-item-head > span:last-child { text-align: center; }
.service-item-row .btn-danger-text { padding: 6px 8px; }

/* 服务列表涉及医院过长时换行 */
.services-table .text-center .badge-soft { margin: 0; }

@media (max-width: 1100px) {
  .service-item-row { grid-template-columns: 1fr 1fr; }
  .service-item-head { display: none; }
}

/* ===== 库存记录弹窗 ===== */
.stock-records-meta {
  font-size: 13px;
  color: #475569;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #eef2f7;
}
.stock-records-meta strong { color: #0f172a; font-size: 15px; }
.stock-records-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.stock-records-list { max-height: 52vh; overflow-y: auto; }
.stock-records-table th, .stock-records-table td { white-space: nowrap; font-size: 13px; }
.stock-records-table .mono { font-weight: 600; letter-spacing: 0.2px; }

.dark .stock-records-meta { background: #1e293b; border-color: #334155; color: #cbd5e1; }
.dark .stock-records-meta strong { color: #f1f5f9; }

/* ===== 加密价格 ===== */
.enc-money {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  letter-spacing: 2px;
  font-weight: 700;
  transition: background 0.15s;
}
.enc-money:hover { background: #e2e8f0; }
.dark .enc-money { background: #1e293b; }
.dark .enc-money:hover { background: #334155; }

/* ===== 供货价 hover 浮层 ===== */
.price-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 8px 0;
  min-width: 180px;
  white-space: nowrap;
}
.price-tooltip-title {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 2px 12px 6px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}
.price-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 12px;
  font-size: 12px;
  color: var(--text-primary);
}
.price-tooltip-row .mono {
  font-weight: 600;
  color: var(--text-primary);
}
