/* ============ 平台店铺运营：数据看板 / 平台库存管理 / 店铺授权 ============ */

/* ---- 店铺授权工具条：新增店铺按钮右对齐 ---- */
.sa-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* ---- 数据看板 ---- */
.od-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.od-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: box-shadow .18s ease, transform .18s ease;
}
.od-kpi:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.od-kpi-ic {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: #eef4ff; color: #2f6bff;
}
.od-kpi.good .od-kpi-ic { background: #e8f9ee; color: #12b76a; }
.od-kpi.bad .od-kpi-ic { background: #fdeeec; color: #f04438; }
.od-kpi-ic svg { width: 20px; height: 20px; }
.od-kpi-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.od-kpi-label { font-size: 12px; color: #667085; }
.od-kpi-body b {
  font-size: 20px; font-weight: 700; color: #101828;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.od-kpi.good .od-kpi-body b { color: #12b76a; }
.od-kpi.bad .od-kpi-body b { color: #f04438; }
.od-kpi-body i { font-style: normal; font-size: 11px; color: #98a2b3; }

.od-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; margin-bottom: 16px; }
.od-card { margin-bottom: 16px; }
.od-card .card-head { display: flex; align-items: baseline; gap: 10px; }
.od-sub { font-size: 12px; color: #98a2b3; }
.od-chart { height: 240px; padding: 4px 8px 0 0; }
.od-chart canvas { width: 100%; height: 100%; }

.od-quick { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.od-quick-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: #f8fafc; border: 1px solid #eef1f6; border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.od-quick-item:hover { background: #eef4ff; border-color: #c7d7ff; }
.od-q-ic {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e8ecf3; border-radius: 8px; color: #2f6bff;
}
.od-q-ic svg { width: 17px; height: 17px; }
.od-quick-item b { display: block; font-size: 13px; color: #101828; }
.od-quick-item i { font-style: normal; font-size: 11px; color: #98a2b3; }

.od-sites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.od-site {
  background: #fbfcfe; border: 1px solid #e8ecf3; border-radius: 12px;
  padding: 14px 16px; cursor: pointer; text-align: left;
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.od-site:hover { border-color: #c7d7ff; box-shadow: 0 6px 16px rgba(47, 107, 255, .10); transform: translateY(-1px); }
.od-site-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.od-site-head b { font-size: 14px; color: #101828; }
.od-site-head span {
  font-size: 11px; color: #2f6bff; background: #eef4ff;
  padding: 2px 8px; border-radius: 999px;
}
.od-site-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
.od-site-kpis div { display: flex; flex-direction: column; gap: 1px; }
.od-site-kpis i { font-style: normal; font-size: 11px; color: #98a2b3; }
.od-site-kpis b { font-size: 14px; font-weight: 600; color: #101828; font-variant-numeric: tabular-nums; }
.od-site-kpis b.neg { color: #f04438; }

.od-inv { display: flex; align-items: center; gap: 16px; }
.od-inv-row { display: flex; gap: 14px; flex: 1; }
.od-inv-item {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  background: #f8fafc; border: 1px solid #eef1f6; border-radius: 10px; padding: 12px 14px;
}
.od-inv-item i { font-style: normal; font-size: 12px; color: #667085; }
.od-inv-item b { font-size: 17px; font-weight: 700; color: #101828; font-variant-numeric: tabular-nums; }

.od-empty { padding: 28px; text-align: center; color: #98a2b3; font-size: 13px; }

/* ---- 库存管理 ---- */
.inv-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.inv-summary { display: flex; gap: 12px; margin-bottom: 14px; }
.inv-sum-item {
  flex: 1; display: flex; align-items: baseline; gap: 10px;
  background: #f8fafc; border: 1px solid #eef1f6; border-radius: 10px; padding: 12px 16px;
}
.inv-sum-item i { font-style: normal; font-size: 12px; color: #667085; }
.inv-sum-item b { font-size: 18px; font-weight: 700; color: #101828; font-variant-numeric: tabular-nums; }

#inv-table th { background: #f8fafc; }
#inv-table td { font-size: 13px; }
.inv-sku { font-weight: 600; color: #101828; font-variant-numeric: tabular-nums; }
.inv-note { color: #667085; }
#inv-table .btn-sm { margin-right: 6px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center;
}
.inv-modal-box {
  width: 460px; max-width: 92vw; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .25);
}
.inv-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.inv-modal-head b { font-size: 15px; color: #101828; }
.inv-modal-head .icon-btn { font-size: 20px; line-height: 1; color: #667085; }
.inv-form { display: flex; flex-direction: column; gap: 12px; }
.inv-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #475467; font-weight: 500; }
.inv-form label i { font-style: normal; color: #f04438; }
.inv-form input, .inv-form select {
  padding: 8px 12px; border: 1px solid #d9dfeb; border-radius: 8px;
  font-size: 13px; color: #101828; outline: none; background: #fff;
}
.inv-form input:focus, .inv-form select:focus { border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.inv-form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.inv-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 1100px) {
  .od-kpis { grid-template-columns: repeat(3, 1fr); }
  .od-grid { grid-template-columns: 1fr; }
  .od-sites { grid-template-columns: 1fr; }
  .od-inv { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .od-kpis { grid-template-columns: 1fr 1fr; }
  .od-inv-row { flex-wrap: wrap; }
  .od-inv-item { flex: 1 1 40%; }
}

/* ============ 店铺授权 ============ */
.sa-loading { padding: 40px 0; text-align: center; color: #98a2b3; font-size: 13px; }

.sa-empty {
  max-width: 560px; margin: 24px auto; padding: 40px 32px;
  text-align: center;
}
.sa-empty-ic {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; background: #eef4ff; color: #2f6bff;
}
.sa-empty-ic svg { width: 28px; height: 28px; }
.sa-empty h3 { font-size: 17px; font-weight: 700; color: #101828; margin-bottom: 8px; }
.sa-empty p { font-size: 13px; color: #667085; margin-bottom: 6px; }
.sa-empty ul {
  list-style: none; padding: 0; margin: 8px 0 20px;
  text-align: left; display: inline-block;
}
.sa-empty li {
  font-size: 13px; color: #475467; padding-left: 18px; position: relative;
  margin-bottom: 6px; text-align: left;
}
.sa-empty li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: #c7d7ff;
}

.sa-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.sa-kpi {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e8ecf3; border-radius: 12px;
  padding: 14px 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.sa-kpi .sa-kpi-label { font-size: 12px; color: #667085; }
.sa-kpi b {
  margin-left: auto; font-size: 22px; font-weight: 700; color: #101828;
  font-variant-numeric: tabular-nums;
}
.sa-kpi.good b { color: #12b76a; }

.sa-alert {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: #b54708; line-height: 1.6;
  background: #fff8ec; border: 1px solid #fee4c4; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px;
}
.sa-alert::before {
  content: ''; flex: 0 0 16px; height: 16px; margin-top: 1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sa-table-card { padding: 0; overflow: hidden; }
.sa-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sa-table th {
  font-size: 12px; font-weight: 600; color: #667085; text-align: left;
  background: #f8fafc; padding: 11px 16px;
  border-bottom: 1px solid #eef1f6;
}
.sa-table td {
  font-size: 13px; color: #101828; padding: 12px 16px;
  border-bottom: 1px solid #f2f4f7;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sa-table tbody tr:last-child td { border-bottom: none; }
.sa-table tbody tr:hover td { background: #fafbfd; }
.sa-name { font-weight: 400; }
.sa-name-line { display: flex; align-items: center; gap: 6px; }
.sa-name-line b { font-weight: 600; }
.sa-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: none; border-radius: 4px;
  background: none; color: #98a2b3; cursor: pointer; padding: 2px;
  visibility: hidden;
}
.sa-table tr:hover .sa-edit { visibility: visible; }
.sa-edit:hover { background: #eef4ff; color: #2f6bff; }
.sa-edit svg { width: 13px; height: 13px; }
.sa-rename-input {
  width: 140px; font-size: 13px; padding: 4px 8px;
  border: 1px solid #2f6bff; border-radius: 6px; outline: none;
}
.sa-uid {
  display: block; margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: #98a2b3;
}
.sa-relink {
  border: none; background: none; padding: 0; margin-left: 8px;
  font-size: 12px; color: #2f6bff; cursor: pointer; white-space: nowrap;
}
.sa-relink:hover { text-decoration: underline; }
.sa-time { font-size: 12px; color: #667085; }
.sa-mp {
  display: inline-block; font-size: 11px; font-weight: 600;
  border-radius: 6px; padding: 2px 8px;
}
.sa-mp.us { background: #eef4ff; color: #2f6bff; }
.sa-mp.jp { background: #fdf0f4; color: #d6497c; }
.sa-st {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  border-radius: 999px; padding: 3px 10px;
}
.sa-st.on { background: #e8f9ee; color: #12b76a; }
.sa-st.on::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sa-st.off { background: #f2f4f7; color: #98a2b3; }
.sa-st.off::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #d0d5dd; }

@media (max-width: 900px) {
  .sa-table-card { overflow-x: auto; }
  .sa-table { min-width: 760px; }
}
@media (max-width: 640px) {
  .sa-kpis { grid-template-columns: 1fr; }
}

/* ============ 平台资金管理 ============ */
.pf-totals { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.pf-total-card {
  flex: 1; min-width: 240px;
  display: flex; align-items: center; gap: 18px;
  background: #f8fafc; border: 1px solid #eef1f6; border-radius: 12px; padding: 14px 18px;
}
.pf-total-card > i {
  font-style: normal; font-weight: 700; font-size: 15px;
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #eef4ff; color: #2f6bff;
}
.pf-total-card div { display: flex; flex-direction: column; gap: 2px; }
.pf-total-card span { font-size: 12px; color: #667085; }
.pf-total-card b { font-size: 17px; font-weight: 700; color: #101828; font-variant-numeric: tabular-nums; }
.pf-total-card b.hl { color: #2f6bff; }
