/* ==========================================================================
   Dapple 树影咖啡 · 商家管理后台
   配色与小程序保持一致：白底 + 主题绿 #1F8A5B
   ========================================================================== */
:root {
  --brand: #1F8A5B;
  --brand-dark: #14663F;
  --brand-soft: #E9F6F0;
  --brand-line: #CBE8DA;

  --bg: #F5F7F6;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-2: #5F6B66;
  --text-3: #9AA5A0;
  --line: #E7EBE9;
  --line-strong: #D6DCD9;

  --danger: #E5533D;
  --danger-soft: #FDEEEA;
  --warn: #D98B1F;
  --warn-soft: #FDF3E3;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(20, 40, 32, 0.06);
  --shadow-lg: 0 8px 32px rgba(20, 40, 32, 0.12);
}

* { box-sizing: border-box; }

/* ==========================================================================
   ★ 关键：让 HTML 的 hidden 属性真正生效
   --------------------------------------------------------------------------
   浏览器默认样式里的 [hidden] { display:none } 优先级极低，
   只要 CSS 里给同一个元素写了 .drawer { display:flex } 就会把它盖掉 ——
   结果是「加了 hidden 的元素照样显示」。
   抽屉、批量操作条、toast 都踩过这个坑，所以这里强制一下。
   ========================================================================== */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ==========================================================================
   布局
   ========================================================================== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- 左侧导航 ---------- */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.brand-text { min-width: 0; }
.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

.nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #F2F5F3; color: var(--text); }
.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.nav-item.is-disabled {
  color: var(--text-3);
  cursor: not-allowed;
}
.nav-item.is-disabled:hover { background: transparent; color: var(--text-3); }
.nav-ico { font-size: 15px; width: 18px; text-align: center; }

.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.version { font-size: 12px; color: var(--text-3); }
.version-sub { font-size: 11px; color: var(--text-3); opacity: .75; margin-top: 2px; }

/* ---------- 主区域 ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  flex-shrink: 0;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-title { font-size: 17px; font-weight: 700; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

.content { padding: 20px 22px 40px; }

/* ==========================================================================
   提示条
   ========================================================================== */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--warn-soft);
  border: 1px solid #F0DCB8;
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: #8A5A12;
  line-height: 1.6;
}
.notice-ico { flex-shrink: 0; }
.notice code {
  background: rgba(0, 0, 0, .06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ==========================================================================
   概览卡片
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.stat-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.stat-card:active { transform: scale(.99); }
.stat-card.is-active { border-color: var(--brand); background: var(--brand-soft); }
.stat-label { font-size: 12px; color: var(--text-3); }
.stat-num {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-num.is-brand { color: var(--brand); }
.stat-num.is-warn { color: var(--warn); }

/* ==========================================================================
   工具条
   ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; }

.input, .select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 138, 91, .12);
}
.input::placeholder { color: var(--text-3); }
.search { width: 260px; }
.select { padding-right: 30px; cursor: pointer; }
.select-sm { height: 32px; font-size: 13px; }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { opacity: .82; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border-color: var(--line-strong); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger-ghost { border-color: #F3C6BC; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-text { color: var(--text-2); padding: 0 8px; }
.btn-text:hover { color: var(--brand); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }

.icon-btn {
  width: 32px; height: 32px;
  border: none; background: transparent;
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 16px;
}
.icon-btn:hover { background: #F2F5F3; color: var(--text); }

/* ==========================================================================
   批量操作条
   ========================================================================== */
.batchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: var(--brand-dark);
}
.batchbar b { font-size: 15px; }

/* ==========================================================================
   表格
   ========================================================================== */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; }

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  padding: 12px 14px;
  background: #FAFCFB;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FAFCFB; }
.table tbody tr.is-offline { background: #FCFCFC; }
.table tbody tr.is-offline td { color: var(--text-3); }

.col-check { width: 44px; }
.row-check { cursor: pointer; accent-color: var(--brand); width: 15px; height: 15px; }
.col-goods { min-width: 240px; }
.col-cat { width: 96px; }
.col-price { width: 110px; }
.col-spec { width: 200px; }
.col-status { width: 130px; }
.col-sort { width: 70px; }
.col-act { width: 252px; }

/* 商品单元格 */
.goods-cell { display: flex; align-items: center; gap: 12px; }
.goods-thumb {
  width: 46px; height: 46px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.goods-thumb.is-soldout::after {
  content: '沽清';
  position: absolute; inset: 0;
  background: rgba(26, 26, 26, .62);
  color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.goods-name { font-weight: 600; color: var(--text); }
.goods-en { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.goods-id { font-size: 10px; color: var(--text-3); opacity: .7; margin-top: 1px; }

/* 价格 */
.price-main { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.price-origin {
  font-size: 11px; color: var(--text-3);
  text-decoration: line-through; margin-left: 5px;
}

/* 规格 */
.spec-text { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.spec-none { color: var(--text-3); }

/* 状态徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-online { background: var(--brand-soft); color: var(--brand); }
.badge-offline { background: #F0F2F1; color: var(--text-3); }
.badge-soldout { background: var(--warn-soft); color: var(--warn); }

/* 表格操作 */
.act-group { display: flex; align-items: center; gap: 2px; }
.act {
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  padding: 4px 7px;
  border-radius: 6px;
  /* ★ 必须 nowrap：不然列一窄，「编辑」会被拆成「编 / 辑」两行 */
  white-space: nowrap;
}
.act:hover { background: var(--brand-soft); }
.act.is-danger { color: var(--danger); }
.act.is-danger:hover { background: var(--danger-soft); }

/* 空状态 */
.empty { padding: 70px 20px; text-align: center; }
.empty-ico { font-size: 42px; opacity: .35; }
.empty-title { font-size: 15px; font-weight: 600; margin-top: 10px; }
.empty-desc { font-size: 13px; color: var(--text-3); margin-top: 4px; }

.table-foot {
  padding: 14px 4px;
  font-size: 12px;
  color: var(--text-3);
}

/* ==========================================================================
   编辑抽屉
   ========================================================================== */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(16, 26, 22, .38);
  z-index: 90;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 620px;
  max-width: 94vw;
  background: var(--card);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideIn .22s cubic-bezier(.22, .86, .3, 1);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .4 } to { transform: none; opacity: 1 } }

.drawer-head {
  height: 60px;
  flex-shrink: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-head h2 { font-size: 16px; font-weight: 700; margin: 0; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 22px 24px;
}

.drawer-foot {
  flex-shrink: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #FCFDFD;
}

/* 表单 */
.form-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.form-section:last-child { border-bottom: none; }
.form-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.star { color: var(--brand); }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.field-row .field { margin-bottom: 0; }

.label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.label i { color: var(--danger); font-style: normal; }
.hint { font-size: 11px; color: var(--text-3); font-weight: 400; }

.input, .select { width: 100%; }
.field .input, .field .select { height: 38px; }

.tip {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
  margin: 8px 0 0;
}

/* 单选/复选 */
.radio-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 38px; }
.radio, .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.radio input, .checkbox input { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; }

/* 开关 */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch-slider {
  width: 42px; height: 24px;
  background: var(--line-strong);
  border-radius: 12px;
  position: relative;
  transition: background .18s;
  flex-shrink: 0;
}
.switch-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-slider { background: var(--brand); }
.switch input:checked + .switch-slider::after { transform: translateX(18px); }
.switch-text { font-size: 12px; color: var(--text-3); }

/* 图片上传 */
.upload-row { display: flex; gap: 16px; align-items: flex-start; }
.upload-preview {
  width: 92px; height: 92px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  background-size: cover;
  background-position: center;
}
.upload-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

/* 占位色选择 */
.tone-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.tone-dot {
  width: 32px; height: 32px;
  border-radius: 9px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .12s, border-color .12s;
}
.tone-dot:hover { transform: scale(1.08); }
.tone-dot.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,138,91,.16); }

/* 占位色板（与小程序 app.wxss 的 .tone-* 一致） */
.tone-esp    { background: linear-gradient(140deg, #8C5A42 0%, #4A2A1C 100%); }
.tone-milk   { background: linear-gradient(140deg, #E8D8C4 0%, #C2A279 100%); }
.tone-brew   { background: linear-gradient(140deg, #B9885A 0%, #6E4526 100%); }
.tone-cold   { background: linear-gradient(140deg, #BFD6DC 0%, #7A9BA8 100%); }
.tone-fruit  { background: linear-gradient(140deg, #F2C0A2 0%, #D97A55 100%); }
.tone-matcha { background: linear-gradient(140deg, #B7D2A6 0%, #5E8C57 100%); }
.tone-tea    { background: linear-gradient(140deg, #DCC9A8 0%, #9C8257 100%); }
.tone-bakery { background: linear-gradient(140deg, #EFD4AA 0%, #C9985A 100%); }

/* ==========================================================================
   规格模板
   ========================================================================== */
.templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tpl {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tpl:hover { border-color: var(--brand-line); }
.tpl.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.tpl-name { font-size: 13px; font-weight: 600; }
.tpl-desc { font-size: 11px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }

/* 维度编辑 */
.groups { display: flex; flex-direction: column; gap: 10px; }
.group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #FCFDFD;
}
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.group-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.group-req {
  font-size: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.group-multi {
  font-size: 10px;
  color: var(--text-3);
  background: #F0F2F1;
  padding: 1px 6px;
  border-radius: 4px;
}
.group-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 5px 8px 5px 10px;
  font-size: 12px;
}
.opt-name { color: var(--text-2); }
.opt-price {
  width: 52px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: center;
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  outline: none;
}
.opt-price:focus { border-color: var(--brand); }
.opt-price::placeholder { color: var(--text-3); font-weight: 400; }
.opt-suffix { font-size: 11px; color: var(--text-3); }

.group-fixed {
  margin-top: 10px;
  font-size: 11px;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 5px 10px;
  border-radius: 6px;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, .92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 200;
  animation: toastIn .2s ease;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* ==========================================================================
   分段控件（时间范围切换）
   ========================================================================== */
.seg {
  display: inline-flex;
  padding: 3px;
  background: #F0F2F1;
  border-radius: 9px;
}
.seg-item {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-2);
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.seg-item:hover { color: var(--text); }
.seg-item.is-active {
  background: #fff;
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 40, 32, .12);
}

/* ==========================================================================
   报表布局
   ========================================================================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px 12px;
  min-width: 0;
}
.panel-wide { grid-column: span 2; }
.panel-full { grid-column: 1 / -1; padding-bottom: 6px; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h3 { font-size: 14px; font-weight: 700; margin: 0; }
.panel-sub { font-size: 12px; color: var(--text-3); }

.chart { width: 100%; min-height: 200px; }
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-3);
  font-size: 13px;
}

/* 指标卡上的环比 */
.stat-delta {
  margin-top: 6px;
  font-size: 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stat-delta.is-up { color: var(--brand); }
.stat-delta.is-down { color: var(--danger); }
.stat-delta-note { color: var(--text-3); font-size: 11px; }
.stat-sub { margin-top: 4px; font-size: 11px; color: var(--text-3); }

.stats-4 { grid-template-columns: repeat(4, 1fr); }

/* 门店对比表格里的占比条 */
.bar-cell {
  height: 8px;
  background: #F0F2F1;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4FB98A 0%, #1F8A5B 100%);
  border-radius: 4px;
  transition: width .4s ease;
}

/* 分类占比里的色点 */
.cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}

/* ==========================================================================
   徽标补充色
   ========================================================================== */
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: #EAF1FE; color: #3D6FD4; }
.badge-muted { background: #F0F2F1; color: var(--text-3); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #1F8A5B 0%, #0F5233 100%);
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 18px;
  padding: 32px 30px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}
.login-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  flex-shrink: 0;
}
.login-title { font-size: 16px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.login-label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin: 14px 0 6px;
  font-weight: 500;
}
.login-box .input { width: 100%; height: 42px; }

.login-btn {
  width: 100%;
  height: 44px;
  margin-top: 22px;
  font-size: 15px;
}
.login-btn:disabled { opacity: .6; cursor: default; }

.login-error {
  padding: 10px 14px;
  background: var(--danger-soft);
  color: #B33A26;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.login-adv {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.login-adv .btn-text { font-size: 12px; color: var(--text-3); background: none; border: none; }
.login-adv .btn-text:hover { color: var(--brand); }
.login-adv #baseBox { margin-top: 10px; text-align: left; }
.login-adv .input { width: 100%; height: 36px; font-size: 13px; }

/* ==========================================================================
   分类管理
   ========================================================================== */
.cat-emoji { font-size: 20px; }

.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-item {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s, transform .1s;
}
.emoji-item:hover { transform: scale(1.06); }
.emoji-item.is-active { border-color: var(--brand); background: var(--brand-soft); }

/* ==========================================================================
   订单详情
   ========================================================================== */
.order-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #F2FAF6 0%, #E3F3EB 100%);
  border-radius: var(--radius-lg);
}
.order-hero-no {
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}
.order-hero-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.order-hero-mode { font-size: 12px; color: var(--text-2); }

.timeline { display: flex; flex-direction: column; gap: 2px; }
.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-3);
}
.timeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  flex-shrink: 0;
}
.timeline-item.is-done { color: var(--text); }
.timeline-item.is-done .timeline-dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(31,138,91,.14); }
.timeline-label { width: 42px; flex-shrink: 0; }
.timeline-time { font-variant-numeric: tabular-nums; font-size: 12px; }

.order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.order-line:last-of-type { border-bottom: none; }
.order-line-main { flex: 1; min-width: 0; }
.order-line-right { text-align: right; flex-shrink: 0; font-size: 12px; color: var(--text-2); }
.order-line-sum { font-weight: 700; color: var(--text); font-size: 14px; }

.order-amounts {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.order-amounts > div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-2);
}
.order-amounts b { color: var(--text); font-variant-numeric: tabular-nums; }
.order-amounts .is-cut { color: var(--danger); }
.order-amounts .is-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.order-amounts .is-total b { font-size: 20px; color: var(--brand); }

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
.kv span { color: var(--text-3); flex-shrink: 0; }
.kv b { font-weight: 500; text-align: right; word-break: break-all; }

/* ==========================================================================
   会员
   ========================================================================== */
.lv-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.lv-1 { background: #F0F2F1; color: #5F6B66; }
.lv-2 { background: #E9F6F0; color: #1F8A5B; }
.lv-3 { background: #EAF1FE; color: #3D6FD4; }
.lv-4 { background: #FDF3E3; color: #B87A15; }

.member-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 18px;
}
.member-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  flex-shrink: 0;
}
.member-hero-info { min-width: 0; }
.member-hero-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.member-hero-phone { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.member-hero-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.member-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.member-metrics > div { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.member-metrics b { font-size: 16px; font-variant-numeric: tabular-nums; }
.member-metrics span { font-size: 11px; color: var(--text-3); }

.coupon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.coupon-row:last-child { border-bottom: none; }
.coupon-row.is-used { opacity: .45; }
.coupon-amt {
  width: 56px; flex-shrink: 0;
  text-align: center;
  font-size: 17px; font-weight: 800;
  color: var(--brand);
}
.coupon-info { min-width: 0; }

/* ==========================================================================
   窄屏适配（老板用手机看也能用）
   ========================================================================== */
@media (max-width: 1180px) {
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-wide { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .stats, .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .search { width: 100%; }
  .toolbar-left { flex: 1; flex-wrap: wrap; }
  .drawer { width: 100% !important; max-width: 100%; }
  .col-spec, .col-sort { display: none; }
  .report-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: span 1; }
  .member-metrics { grid-template-columns: repeat(2, 1fr); }
}
