/* ============================================================
   E · Warehouse / Rehearsal / Shipment shared module
   依赖 _tokens.css · _e-fashion.css · _e-orders.css(sidebar)· _e-form.css
   适用 W1–W5(代购流程 5 张)
   ============================================================ */

/* ───────── KPI hero strip (warehouse / rehearsal / shipment 都用) ───────── */
.e-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
@media (max-width: 720px) { .e-kpi-row { grid-template-columns: repeat(2, 1fr); } }

.e-kpi { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 16px 18px; position: relative; overflow: hidden; }
.e-kpi__k { font-family: var(--font-mono); font-size: 10px; color: var(--color-text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.e-kpi__v { font-family: var(--font-display); font-size: 24px; font-weight: 900; color: var(--color-text); letter-spacing: -0.02em; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.e-kpi__s { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }
.e-kpi--accent { background: linear-gradient(135deg, var(--color-primary-soft), #fff); border-color: rgba(11,168,136,.3); }
.e-kpi--accent .e-kpi__v { color: var(--color-primary-fill); }
.e-kpi--warn { background: linear-gradient(135deg, var(--color-sticker-yellow-soft), #fff); border-color: rgba(255,210,63,.5); }
.e-kpi--warn .e-kpi__v { color: var(--color-sticker-yellow-fg); }
.e-kpi--coral { background: linear-gradient(135deg, var(--color-cta-soft), #fff); border-color: rgba(255,107,74,.3); }
.e-kpi--coral .e-kpi__v { color: var(--color-cta); }

/* ───────── Action toolbar (with bulk select) ───────── */
.e-bulk-bar { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.e-bulk-bar__t { font-size: 13px; font-weight: 700; }
.e-bulk-bar__t strong { color: var(--color-primary-fill); }
.e-bulk-bar__chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 200px; }
.e-bulk-bar__r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ───────── Warehouse item card ───────── */
.e-wh-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: 18px 20px; display: grid; grid-template-columns: 24px 88px 1fr auto; gap: 16px; align-items: flex-start; transition: border-color var(--duration-fast) var(--ease-out); }
.e-wh-card:hover { border-color: var(--color-border-strong); }
.e-wh-card.is-selected { border-color: var(--color-primary-fill); background: linear-gradient(180deg, var(--color-primary-soft) 0%, #fff 30%); }
.e-wh-card + .e-wh-card { margin-top: 10px; }
@media (max-width: 720px) { .e-wh-card { grid-template-columns: 24px 88px 1fr; } .e-wh-card__r { grid-column: 2 / -1; padding-top: 8px; border-top: 1px dashed var(--color-border); margin-top: 4px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; } }

.e-wh-card__check { width: 22px; height: 22px; border: 1.5px solid var(--color-border-strong); border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; margin-top: 4px; }
.e-wh-card__check.is-checked { background: var(--color-primary-fill); border-color: var(--color-primary-fill); }
.e-wh-card__check.is-checked::after { content: ""; width: 12px; height: 7px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(0,-1px); }
.e-wh-card__check.is-locked { cursor: not-allowed; opacity: .4; background: var(--color-surface); }

.e-wh-card__img { width: 88px; height: 88px; border-radius: 12px; background: var(--color-surface); display: grid; place-items: center; font-size: 36px; overflow: hidden; flex-shrink: 0; position: relative; }
.e-wh-card__img__plat { position: absolute; bottom: 4px; left: 4px; background: rgba(15,31,26,.8); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.03em; }

.e-wh-card__main { min-width: 0; }
.e-wh-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.e-wh-card__t { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--color-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.e-wh-card__sku { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.e-wh-card__sku span { padding: 1px 6px; background: var(--color-surface); border-radius: 4px; }
.e-wh-card__attrs { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; flex-wrap: wrap; }
.e-wh-card__attr { display: flex; flex-direction: column; gap: 2px; }
.e-wh-card__attr__k { font-size: 10px; color: var(--color-text-muted); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.e-wh-card__attr__v { font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }
.e-wh-card__attr--accent .e-wh-card__attr__v { color: var(--color-primary-fill); }
.e-wh-card__attr--warn .e-wh-card__attr__v { color: var(--color-warning-foreground); }

.e-wh-card__photos { display: flex; gap: 4px; margin-top: 10px; align-items: center; }
.e-wh-card__photo { width: 32px; height: 32px; border-radius: 6px; background: var(--color-surface); display: grid; place-items: center; font-size: 16px; cursor: pointer; border: 1px solid var(--color-border); position: relative; overflow: hidden; }
.e-wh-card__photo--more { background: var(--color-text); color: #fff; font-size: 10px; font-weight: 800; font-family: var(--font-mono); }
.e-wh-card__photo-hint { font-size: 11px; color: var(--color-text-muted); margin-left: 6px; font-weight: 600; }

.e-wh-card__r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-left: 16px; border-left: 1px solid var(--color-border); min-width: 180px; }
@media (max-width: 720px) { .e-wh-card__r { padding-left: 0; border-left: 0; min-width: 0; align-items: stretch; } }

.e-wh-card__price-hint { font-size: 10px; color: var(--color-text-muted); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.e-wh-card__price { font-family: var(--font-display); font-size: 18px; font-weight: 900; color: var(--color-text); letter-spacing: -0.005em; line-height: 1; font-variant-numeric: tabular-nums; }
.e-wh-card__price__cn { font-size: 11px; color: var(--color-text-muted); font-family: var(--font-mono); margin-top: 2px; }
.e-wh-card__days { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--color-text-muted); margin-top: 4px; padding: 3px 8px; background: var(--color-surface); border-radius: 999px; }
.e-wh-card__days--warn { background: var(--color-warning-soft); color: var(--color-warning-foreground); border: 1px solid rgba(255,162,0,.3); }
.e-wh-card__days--danger { background: var(--color-danger-soft); color: var(--color-danger); border: 1px solid rgba(255,46,99,.3); }

.e-wh-card__actions { display: flex; gap: 6px; margin-top: auto; }
.e-wh-card__actions .e-btn { padding: 6px 12px; font-size: 12px; min-height: 32px; }

/* —— Status badges for warehouse items —— */
.e-wh-st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.e-wh-st__dot { width: 5px; height: 5px; border-radius: 50%; }
.e-wh-st--arrived { background: var(--color-primary-soft); color: var(--color-primary-fill); }
.e-wh-st--arrived .e-wh-st__dot { background: var(--color-primary-fill); }
.e-wh-st--photo { background: var(--color-sticker-yellow-soft); color: var(--color-sticker-yellow-fg); border: 1px solid var(--color-sticker-yellow); }
.e-wh-st--photo .e-wh-st__dot { background: var(--color-sticker-yellow); animation: e-pulse 1.5s ease-in-out infinite; }
.e-wh-st--reserved { background: var(--color-info-soft); color: var(--color-info); }
.e-wh-st--reserved .e-wh-st__dot { background: var(--color-info); }
.e-wh-st--issue { background: var(--color-danger-soft); color: var(--color-danger); }
.e-wh-st--issue .e-wh-st__dot { background: var(--color-danger); animation: e-pulse 1.5s ease-in-out infinite; }

/* ───────── Sticky bottom action bar ───────── */
.e-sticky-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: rgba(15,31,26,.98);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 16px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  margin-top: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 -4px 20px rgba(15,31,26,.15);
}
@media (max-width: 720px) { .e-sticky-bar { grid-template-columns: 1fr; gap: 12px; padding: 16px; } }
.e-sticky-bar__check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.e-sticky-bar__check__box { width: 18px; height: 18px; border: 1.5px solid rgba(255,255,255,.5); border-radius: 5px; background: transparent; display: grid; place-items: center; }
.e-sticky-bar__check.is-checked .e-sticky-bar__check__box { background: var(--color-primary); border-color: var(--color-primary); }
.e-sticky-bar__check.is-checked .e-sticky-bar__check__box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(0,-1px); }
.e-sticky-bar__summary { font-size: 13px; color: rgba(255,255,255,.7); }
.e-sticky-bar__summary strong { color: var(--color-sticker-yellow); font-weight: 800; font-family: var(--font-display); font-size: 17px; margin: 0 4px; }
.e-sticky-bar__r { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.e-sticky-bar__est { font-family: var(--font-display); font-size: 15px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.e-sticky-bar__est__k { font-size: 11px; color: rgba(255,255,255,.6); font-weight: 500; font-family: var(--font-sans); margin-right: 6px; }

/* ───────── Tag chips (custom labels) ───────── */
.e-tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: var(--color-secondary-soft); color: var(--color-secondary); font-size: 10px; font-weight: 700; border-radius: 4px; letter-spacing: 0.02em; }
.e-tag-chip--coral { background: var(--color-cta-soft); color: var(--color-cta); }
.e-tag-chip--teal { background: var(--color-primary-soft); color: var(--color-primary-fill); }
.e-tag-chip--yellow { background: var(--color-sticker-yellow-soft); color: var(--color-sticker-yellow-fg); }

/* ───────── Filter bar (warehouse / shipment 都用) ───────── */
.e-wh-filter { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 4px; display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.e-wh-filter::-webkit-scrollbar { display: none; }
.e-wh-filter button { background: transparent; border: 0; padding: 8px 14px; border-radius: 10px; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--color-text-muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.e-wh-filter button:hover:not(.is-active) { color: var(--color-text); background: var(--color-surface); }
.e-wh-filter button.is-active { background: var(--color-text); color: #fff; }
.e-wh-filter button .count { font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; background: var(--color-surface); color: var(--color-text-muted); border-radius: 999px; font-weight: 800; }
.e-wh-filter button.is-active .count { background: var(--color-primary); color: #fff; }
