/* =====================================================================
 * 小邻里超市 · 设计系统（商城顾客端 + 管理后台共用）
 *   纯 CSS 变量 + 组件类，无框架、无构建。
 *   风格：浅色、圆角、柔和阴影、绿色品牌色，贴近现代商城后台。
 * ===================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  --brand: #16a34a;
  --brand-dark: #15803d;
  --brand-light: #ecfdf3;
  --brand-ring: rgba(22, 163, 74, .18);

  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e6e9ee;
  --line-2: #eef1f5;

  --amber: #b45309;      --amber-bg: #fffbeb;   --amber-line: #fde68a;
  --blue: #1d4ed8;       --blue-bg: #eff6ff;    --blue-line: #bfdbfe;
  --violet: #6d28d9;     --violet-bg: #f5f3ff;  --violet-line: #ddd6fe;
  --green: #15803d;      --green-bg: #ecfdf3;   --green-line: #bbf7d0;
  --red: #b91c1c;        --red-bg: #fef2f2;     --red-line: #fecaca;
  --slate: #475569;      --slate-bg: #f1f5f9;   --slate-line: #e2e8f0;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(16, 24, 40, .04);
  --sh-2: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --sh-3: 0 12px 40px rgba(16, 24, 40, .16);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5dae2; border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- 通用小件 ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 20px; }
.hide { display: none !important; }

/* 连接状态胶囊 */
.pill-mode {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  background: var(--slate-bg); color: var(--slate);
  border: 1px solid var(--slate-line);
  white-space: nowrap; cursor: default;
}
.pill-mode::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-mode.on { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.pill-mode.off { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }

/* 状态徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.badge.st-pending    { background: var(--amber-bg);  color: var(--amber);   border: 1px solid var(--amber-line); }
.badge.st-delivering { background: var(--blue-bg);   color: var(--blue);    border: 1px solid var(--blue-line); }
.badge.st-ready      { background: var(--violet-bg); color: var(--violet);  border: 1px solid var(--violet-line); }
.badge.st-done       { background: var(--green-bg);  color: var(--green);   border: 1px solid var(--green-line); }
.badge.st-cancelled  { background: var(--slate-bg);  color: var(--slate);   border: 1px solid var(--slate-line); }
.badge.st-warn       { background: var(--red-bg);    color: var(--red);     border: 1px solid var(--red-line); }
.badge.st-info       { background: var(--blue-bg);   color: var(--blue);    border: 1px solid var(--blue-line); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cfd6e0; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(22,163,74,.25); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); border-color: transparent; }
.btn-danger { background: #fff; border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-outline { background:#fff; border-color: var(--green-line); color: var(--green); }
.btn-outline:hover { background: var(--brand-light); }
.btn-xs { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.dis { opacity: .45; pointer-events: none; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px;
  font-family: inherit; font-size: 13px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder { color: var(--faint); }
.input-sm { padding: 6px 9px; font-size: 12px; width: 84px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 8px 14px;
}
.search input { flex: 1; border: 0; outline: none; font: inherit; font-size: 13px; background: transparent; color: var(--ink); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

/* 分类 / 筛选 chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: var(--r-pill);
  background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); cursor: pointer; transition: .15s;
  white-space: nowrap;
}
.chip:hover { border-color: #cfd6e0; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }

/* 卡片 / 面板 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.panel-head h3 { font-size: 15px; }
.panel-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 12px 14px; }

/* 数据看板 KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-1); }
.kpi .k-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
/* nowrap：像「¥27.00 / ¥172.00」这种成对数值必须留在同一行，不许被折成两行 */
.kpi .k-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; white-space: nowrap; }
/* 成对/较长数值（例如「¥27.00 / ¥172.00」）按字符数自动降档，避免撑破卡片 */
.kpi .k-value.sm { font-size: 19px; }
.kpi .k-value.xs { font-size: 15px; }
.kpi .k-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .k-foot { font-size: 12px; color: var(--faint); margin-top: 4px; }
.kpi.accent { background: linear-gradient(135deg, #16a34a, #0ea5e9); border-color: transparent; color: #fff; }
.kpi.accent .k-label, .kpi.accent .k-foot { color: rgba(255,255,255,.85); }
.kpi.accent .k-value small { color: rgba(255,255,255,.85); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #fcfdfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--mono); }
.table-wrap { overflow-x: auto; }

/* 空态 */
.empty { padding: 44px 20px; text-align: center; color: var(--faint); font-size: 13px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: .7; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, .94); color: #fff;
  padding: 11px 20px; border-radius: var(--r-pill);
  font-size: 13px; max-width: 82vw; z-index: 300;
  box-shadow: var(--sh-3); opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 遮罩 / 抽屉 / 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 90; opacity: 0; pointer-events: none; transition: .2s; }
.mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  background: #fff; z-index: 100; display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .24s cubic-bezier(.32,.72,0,1);
  box-shadow: var(--sh-3);
}
.drawer.show { transform: translateX(0); }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line-2); background: #fcfdfe; }
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98);
  width: 560px; max-width: 94vw; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: var(--r-lg); z-index: 100;
  box-shadow: var(--sh-3); opacity: 0; pointer-events: none; transition: .2s;
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: #fcfdfe; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.icon-btn { border: 0; background: transparent; font-size: 18px; color: var(--faint); cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

/* 通用列表行 */
.line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.line:last-child { border-bottom: 0; }
.line .k { color: var(--muted); }

/* =============== 顾客端（index.html） =============== */
.shop { max-width: 1080px; margin: 0 auto; padding: 0 16px 120px; }
.shop-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(244, 246, 248, .88); backdrop-filter: blur(10px);
  padding: 14px 0 10px; margin-bottom: 6px;
}
.shop-head .brand { display: flex; align-items: center; gap: 10px; }
.shop-head .logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #22c55e, #0ea5e9); color: #fff; font-size: 19px;
  box-shadow: 0 4px 12px rgba(22,163,74,.28);
}
.shop-head .name { font-size: 17px; font-weight: 600; }
.shop-head .sub { font-size: 12px; color: var(--muted); }
.shop-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.cart-btn:hover { border-color: #cfd6e0; }
.cart-dot {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff;
}
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #ecfdf3, #eff6ff);
  border: 1px solid var(--green-line); border-radius: var(--r-lg);
  padding: 18px 22px; margin: 8px 0 16px;
}
.hero h2 { font-size: 18px; }
.hero p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.hero .tag { font-size: 12px; padding: 5px 12px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--green-line); color: var(--green); white-space: nowrap; }

.cat-bar { position: sticky; top: 116px; z-index: 30; background: rgba(244,246,248,.92); backdrop-filter: blur(10px); padding: 8px 0 10px; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; margin-top: 6px; }
.pcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--sh-1); transition: .18s; cursor: pointer; display: flex; flex-direction: column;
}
.pcard:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: #dbe1e8; }
.pcard .ph { height: 132px; display: grid; place-items: center; font-size: 46px; background: linear-gradient(140deg, #f8fafc, #eef2f7); position: relative; }
.pcard .ph .oos { position: absolute; inset: 0; background: rgba(255,255,255,.66); display: grid; place-items: center; color: var(--slate); font-size: 13px; font-weight: 500; }
/* 商品图片（任务池⑥）：有图铺满，没图仍用 emoji 占位 */
.pcard .ph .pimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .pb { padding: 12px 13px 14px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.pcard .pname { font-size: 14px; font-weight: 500; line-height: 1.35; }
.pcard .pmeta { font-size: 12px; color: var(--faint); }
.pcard .pfoot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { color: #e11d48; font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.price small { font-size: 12px; font-weight: 400; color: var(--faint); }
.stk { font-size: 11px; color: var(--faint); }
.stk.out { color: var(--red); }
.add {
  border: 0; background: var(--brand); color: #fff; width: 30px; height: 30px; border-radius: 50%;
  font-size: 17px; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(22,163,74,.34);
}
.add:hover { background: var(--brand-dark); }

.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60;
  width: min(1040px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(15, 23, 42, .95); color: #fff; padding: 12px 18px; border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
}
.cartbar .n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--brand); font-size: 12px; font-weight: 600; margin-right: 8px; }
.cartbar .go { background: var(--brand); color: #fff; border: 0; padding: 9px 20px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; cursor: pointer; }
.cartbar .go:hover { background: var(--brand-dark); }

/* 购物车行 */
.citem { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.citem .cph { width: 44px; height: 44px; border-radius: 10px; background: #f1f5f9; display: grid; place-items: center; font-size: 22px; overflow: hidden; }
.citem .cph .cimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.citem .cn { font-size: 13px; font-weight: 500; }
.citem .cs { font-size: 12px; color: var(--faint); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.stepper button { width: 28px; height: 28px; border: 0; background: #fff; cursor: pointer; font-size: 15px; color: var(--ink-2); }
.stepper button:hover { background: var(--line-2); }
.stepper .v { min-width: 34px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.deliv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dopt {
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; background: #fff; transition: .15s;
}
.dopt.on { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 0 0 3px var(--brand-ring); }
.dopt b { display: block; font-size: 13px; }
.dopt span { font-size: 12px; color: var(--muted); }
.sum-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--ink-2); }
.sum-line.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 15px; font-weight: 600; }
.sum-line.total b { color: #e11d48; font-size: 19px; }

/* 订单卡（顾客端） */
.ocard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--sh-1); }
.ocard .oh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ocard .oid { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ocard .items { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.ocard .of { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ocard .of .amt { font-size: 13px; color: var(--muted); }
.ocard .of .amt b { color: #e11d48; font-size: 16px; }

/* =============== 管理后台（admin.html） =============== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 218px; flex: 0 0 218px; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.sidebar .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #22c55e, #0ea5e9); font-size: 17px; }
.sidebar .bn { color: #fff; font-size: 15px; font-weight: 600; line-height: 1.2; }
.sidebar .bs { font-size: 11px; color: #7c8ba1; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav .nv {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #cbd5e1; font-size: 13.5px; cursor: pointer; transition: .15s; border: 0; background: transparent; text-align: left; width: 100%;
}
.nav .nv:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav .nv.on { background: var(--brand); color: #fff; font-weight: 500; }
.nav .nv i { font-style: normal; width: 18px; text-align: center; font-size: 15px; }
.sidebar .foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #7c8ba1; line-height: 1.7; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(244,246,248,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.topbar h1 { font-size: 18px; }
.topbar .crumb { font-size: 12px; color: var(--muted); margin-top: 2px; }
.page { padding: 20px 24px 40px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* 订单卡（后台，更紧凑） */
.ocard .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sel { padding: 5px 9px; font-size: 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-family: inherit; }

/* 库存操作块 */
.stkrow { display: grid; grid-template-columns: 260px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.stkrow:last-child { border-bottom: 0; }
.stkrow .sname { font-size: 14px; font-weight: 500; }
.stkrow .smeta { font-size: 12px; color: var(--faint); margin-top: 3px; line-height: 1.6; }
.stkrow .scur { margin-top: 8px; font-size: 13px; color: var(--muted); }
.stkrow .scur b { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.opgrid { display: flex; flex-direction: column; gap: 9px; }
.opline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opline .lb { font-size: 12px; color: var(--muted); min-width: 58px; }
.opline .inp { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; font-family: inherit; width: 96px; }
.opline .inp.wide { width: 180px; }
.opline .inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

/* 流水 */
.logline { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2); }
.logline:last-child { border-bottom: 0; }
.logline .ts { color: var(--faint); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.lgt { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.lgt.in { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line); }
.lgt.adj { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-line); }
.lgt.take { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-line); }

/* 顾客档案 */
.custcard { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.custcard .ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.custcard .cn { font-size: 14px; font-weight: 500; }
.custcard .cp { font-size: 12px; color: var(--faint); margin-top: 2px; }
.custcard .cstats { font-size: 12.5px; color: var(--muted); margin: 10px 0; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.custcard .cstats b { color: var(--ink); }

/* 响应式 */
@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 200; transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: none; }
  .stkrow { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .kpis { grid-template-columns: 1fr; }
  .page { padding: 16px 14px 40px; }
  .hero { flex-direction: column; align-items: flex-start; }
}
