/* ============================================================
   活动管理系统 - 现代主题样式 (v5)
   设计：深靛蓝侧边栏 + 明亮卡片式内容区
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --primary-50: #eef2ff;
  --accent: #2563eb;
  --success: #10b981;
  --success-50: #ecfdf5;
  --warning: #f59e0b;
  --warning-50: #fffbeb;
  --danger: #ef4444;
  --danger-50: #fef2f2;
  --purple: #8b5cf6;
  --purple-50: #f5f3ff;
  --orange: #f97316;
  --orange-50: #fff7ed;
  --teal: #14b8a6;
  --teal-50: #f0fdfa;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --sidebar-w: 236px;
  --topbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--gray-800);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 6px; }
body::-webkit-scrollbar-track { background: transparent; }

a { color: var(--accent); text-decoration: none; }

/* ============ 侧边栏 ============ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 45%, #3730a3 100%);
  color: rgba(255, 255, 255, 0.82);
  z-index: 100;
  box-shadow: 2px 0 18px rgba(15, 23, 42, 0.18);
  transition: width 0.22s ease;
}

/* 折叠/展开箭头按钮（电脑端） */
.sidebar-collapse-btn {
  position: absolute;
  top: 50%;
  right: -13px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  cursor: pointer;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  line-height: 1;
  padding: 0;
  transition: all 0.22s ease;
}
.sidebar-collapse-btn:hover { color: var(--primary); border-color: var(--primary); }
.sidebar-collapse-btn::before { content: "\276E"; }
body.sidebar-collapsed .sidebar-collapse-btn::before { content: "\276F"; }

/* 收起状态：窄条只留图标 */
body.sidebar-collapsed .sidebar { width: 64px; }
body.sidebar-collapsed .sidebar-header { padding: 16px 8px 10px; }
body.sidebar-collapsed .sidebar-header img { width: 38px; height: 38px; margin-bottom: 0; }
body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-subtitle,
body.sidebar-collapsed .sidebar-divider { display: none; }
body.sidebar-collapsed .sidebar-nav { padding: 14px 6px; }
body.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  padding: 11px 0;
  gap: 0;
}
body.sidebar-collapsed .sidebar-nav a .icon { width: auto; font-size: 17px; }
body.sidebar-collapsed .sidebar-nav a .nav-text { display: none; }
body.sidebar-collapsed .sidebar-footer { padding: 12px 8px; text-align: center; }
body.sidebar-collapsed .sidebar-foot-text { display: none; }
body.sidebar-collapsed .sidebar-footer a { display: block; font-size: 12.5px; margin: 4px 0; }
body.sidebar-collapsed .main-content { margin-left: 64px; }

.sidebar-header {
  padding: 22px 20px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.sidebar-subtitle {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 14px 0 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  margin-bottom: 3px;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  transition: all 0.16s ease;
}

.sidebar-nav a .icon { width: 20px; text-align: center; font-size: 15px; }

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-nav a.active {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
}

.sidebar-footer a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13.5px;
  transition: color 0.15s;
}
.sidebar-footer a:hover { color: #fff; }

/* ============ 主内容区 ============ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  z-index: 50;
}

.topbar h4 { margin: 0; font-size: 17px; font-weight: 700; color: var(--gray-800); }

.user-info {
  font-size: 15px;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 500;
}

.menu-toggle {
  display: none;
  border: none;
  background: var(--gray-100);
  color: var(--gray-700);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

.content-wrap {
  padding: 24px;
  flex: 1;
}

/* ============ 卡片 ============ */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 15px 20px;
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-100);
  background: linear-gradient(180deg, #fcfcfd, #f8fafc);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 18px 20px; }

.card-blue, .card-green, .card-orange, .card-purple, .card-red, .card-teal {
  border-left: 4px solid var(--primary);
}
.card-blue { border-left-color: var(--accent); }
.card-green { border-left-color: var(--success); }
.card-orange { border-left-color: var(--orange); }
.card-purple { border-left-color: var(--purple); }
.card-red { border-left-color: var(--danger); }
.card-teal { border-left-color: var(--teal); }

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ 表格 ============ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table-wrap thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.3px;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table-wrap tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr { transition: background 0.12s; }
.table-wrap tbody tr:hover { background: var(--primary-50); }

/* [2026-09-21] 客户管理：姓名列按内容收缩（width:1% 是表格里的标准"贴合内容"写法）
   三个字约 77px；遇到更长姓名（如 唐甸容（朋友））该列自动放宽，不会被截断 */
.customer-table th:first-child,
.customer-table td:first-child { width: 1%; white-space: nowrap; }

/* [2026-10-16] 客户列表「操作」列：按钮等宽对齐
   原来按钮是行内空格分隔，字数不一（详情/转移/编辑/续购/删除）导致整列参差；
   且样式混着紫边框、蓝渐变、红实心，观感不统一。
   现统一为描边按钮基线 + 等宽 + 等高 + 一致间距，只保留克制的强调色。 */
.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.row-actions .row-act {
  min-width: 58px;              /* 两个字按钮等宽，整列对齐 */
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  justify-content: center;
}
.row-actions .row-act-key {     /* 关键动作：仅描边描色，不做实心，避免整列花掉 */
  border-color: #8b5cf6;
  color: #6d28d9;
  background: #faf5ff;
}
.row-actions .row-act-key:hover { background: #f3e8ff; }
.row-actions .row-act-danger {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fff;
}
.row-actions .row-act-danger:hover { background: #fef2f2; }

.customer-table td:last-child { white-space: nowrap; }
.customer-table td:last-child .row-actions { justify-content: flex-start; }

/* [2026-10-16] 操作列做减法：2 个主按钮 + 「⋯」菜单，不再 5 个平铺撑爆表格 */
.customer-table td:last-child { width: 1%; }
.row-actions .row-act-more { min-width: 34px; padding: 5px 8px; font-weight: 700; }
.row-actions { position: relative; }
.row-more {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 132px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  padding: 4px;
  flex-direction: column;
}
.row-more.open { display: flex; }
.row-more button {
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--gray-700);
  cursor: pointer;
}
.row-more button:hover { background: var(--gray-100); }
.row-more button.danger { color: #b91c1c; }
.row-more button.danger:hover { background: #fef2f2; }

/* 业务员/操作员合并单元格 */
.sm-cell { display: inline-flex; flex-direction: column; line-height: 1.35; }
.sm-cell b { font-weight: 600; color: var(--gray-800); }
.sm-cell em { font-style: normal; font-size: 12.5px; color: var(--gray-400); }

/* 视图切换按钮组 */
.view-switch { display: inline-flex; border: 1px solid var(--gray-300); border-radius: 8px; overflow: hidden; }
.view-switch button {
  border: 0; background: #fff; padding: 5px 12px; font-size: 13px; cursor: pointer;
  font-family: var(--font); color: var(--gray-600);
}
.view-switch button.active { background: var(--primary-50); color: var(--primary-dark); font-weight: 700; }

/* 简洁视图：隐藏次要列（身份证 / 活动类型 / 业绩归属-录入人）——
   合并两列后列序为 1姓名 2电话 3身份证 4套餐 5套数 6活动类型 7业绩归属 8赠送 9时间 10操作 */
body.cust-compact .customer-table th:nth-child(3),
body.cust-compact .customer-table td:nth-child(3),
body.cust-compact .customer-table th:nth-child(6),
body.cust-compact .customer-table td:nth-child(6),
body.cust-compact .customer-table th:nth-child(7),
body.cust-compact .customer-table td:nth-child(7) { display: none; }

/* 核销记录：客户列同客户管理，按内容收缩 + 不换行（表格第 2 列） */
.rec-table th:nth-child(2),
.rec-table td:nth-child(2) { width: 1%; white-space: nowrap; }

.performance-table-wrap {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.performance-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.performance-table-wrap thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.performance-table-wrap tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.performance-table-wrap tbody tr:hover { background: var(--primary-50); }
.performance-table-wrap tfoot td {
  padding: 13px 16px;
  font-weight: 700;
  background: var(--gray-50);
  color: var(--gray-800);
}

.detail-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.detail-table th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.detail-table td { padding: 9px 14px; border-bottom: 1px solid var(--gray-100); }
.detail-table tbody tr:last-child td { border-bottom: none; }
.detail-table tbody tr:hover { background: var(--primary-50); }

.data-cell { text-align: center; font-variant-numeric: tabular-nums; }
.data-cell-primary { color: var(--primary); font-weight: 700; }
.data-cell-success { color: var(--success); font-weight: 700; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(79, 70, 229, 0.42); filter: brightness(1.05); }

.btn-outline {
  background: #fff;
  border-color: var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { filter: brightness(1.05); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.05); }

.btn-subtle {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-subtle:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-sm { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* [2026-09-30] 补 .form-select：原来样式表里根本没有它，状态下拉一直用
   浏览器原生外观（白底、无边框、只有 24px 高），跟旁边 .form-control
   放一起看着完全不同。镜像 .form-control 的样式保持一致。 */
.form-select {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}


.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

select.form-control { cursor: pointer; }

input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ============ 筛选条 / 工具栏 ============ */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }

.page-info { font-size: 15px; color: var(--gray-500); }

/* ============ 分页 ============ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 20px;
}

.pagination .btn {
  padding: 7px 13px;
  font-size: 13.5px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.pagination .btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.pagination .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .btn.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
}

/* ============ 状态徽章 ============ */
.status-pending,
.status-completed,
.status-cancelled {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
}

.status-pending { background: var(--warning-50); color: #b45309; border: 1px solid #fde68a; }
.status-completed { background: var(--success-50); color: #047857; border: 1px solid #a7f3d0; }
.status-cancelled { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }

/* ============ 统计卡片 ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 118px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-top { display: flex; align-items: center; justify-content: center; gap: 10px; }
.card-green .stat-icon { background: var(--success-50); color: var(--success); }
.card-orange .stat-icon { background: var(--orange-50); color: var(--orange); }
.card-teal .stat-icon { background: var(--teal-50); color: var(--teal); }
.card-blue .stat-icon { background: var(--primary-50); color: var(--accent); }
.card-red .stat-icon { background: var(--danger-50); color: var(--danger); }
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--primary-50);
  color: var(--primary);
  flex-shrink: 0;
}

.stat-label { font-size: 13.5px; color: var(--gray-500); font-weight: 500; }
.stat-main { margin-top: 12px; display: flex; flex-direction: column; align-items: center; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1.1; }
.stat-sub { font-size: 12.5px; color: var(--gray-400); font-weight: 500; margin-top: 3px; }
.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.stat-card-sm {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card-sm:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.sc-label { font-size: 13.5px; font-weight: 600; color: var(--gray-600); display: flex; align-items: center; gap: 6px; }
.sc-value { font-size: 24px; font-weight: 800; color: var(--gray-900); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.sc-sub { font-size: 12.5px; color: var(--gray-400); }

.sc-blue .sc-label { color: var(--accent); }
.sc-green .sc-label { color: var(--success); }
.sc-orange .sc-label { color: var(--orange); }
.sc-purple .sc-label { color: var(--purple); }

/* ============ 概览卡（业绩/销售） ============ */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.overview-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ov-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--primary-50);
  color: var(--primary);
}

.ov-label { font-size: 13.5px; color: var(--gray-500); }
.ov-value { font-size: 20px; font-weight: 800; color: var(--gray-900); }
.ov-sub { font-size: 12.5px; color: var(--gray-400); margin-top: 1px; }

.oc-primary .ov-icon { background: var(--primary-50); color: var(--primary); }
.oc-success .ov-icon { background: var(--success-50); color: var(--success); }
.oc-warning .ov-icon { background: var(--warning-50); color: var(--warning); }

/* ============ 业绩排名 ============ */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: var(--gray-300);
}

.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1e293b; }
.bronze { background: linear-gradient(135deg, #f59e0b, #b45309); color: #fff; }

.row-gold td:first-child, .row-silver td:first-child, .row-bronze td:first-child {
  font-weight: 700;
}

.gold-avatar, .silver-avatar, .bronze-avatar {
  border: 2px solid var(--primary-50);
}

.salesman-cell { display: flex; align-items: center; gap: 10px; }
.salesman-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.salesman-name { font-weight: 600; color: var(--gray-800); }
.salesman-sub { font-size: 12.5px; color: var(--gray-400); }

/* ============ 时间段切换 ============ */
.period-switch {
  display: inline-flex;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}

.period-switch-lg { padding: 6px; }

.period-btn {
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: 15px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.period-btn:hover { color: var(--gray-800); }
.period-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.2s ease;
}

.modal-content h3 { margin: 0 0 16px; font-size: 17px; color: var(--gray-900); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 0 0;
  margin-top: 18px;
  border-top: 1px solid var(--gray-100);
}

/* 表单分组标题 */
.form-section {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0 8px;
  padding-left: 9px;
  border-left: 3px solid var(--primary);
  line-height: 1.4;
}
.form-section:first-of-type { margin-top: 4px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============ 确认对话框 ============ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.18s ease;
}

.confirm-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 380px;
  max-width: 92vw;
  padding: 26px;
  text-align: center;
  animation: slideUp 0.2s ease;
}

.confirm-icon { font-size: 40px; margin-bottom: 8px; }
.confirm-box h4 { margin: 0 0 8px; font-size: 15px; color: var(--gray-900); }
.confirm-box p { margin: 0 0 20px; font-size: 15px; color: var(--gray-500); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ============ Toast 提示 ============ */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 400;
}

.toast {
  min-width: 240px;
  max-width: 380px;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-800);
  background: #fff;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--gray-300);
  animation: slideRight 0.22s ease;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }

@keyframes slideRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

/* ============ 加载 ============ */
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.spinner-lg { width: 42px; height: 42px; border-width: 4px; }

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--gray-400);
  font-size: 15px;
}

.loading-row td { text-align: center; padding: 30px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 工具类 ============ */
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.fs-12 { font-size: 13.5px; }
.fs-14 { font-size: 15px; }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }

.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col { grid-column: span 12; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 500px at 15% 10%, rgba(99, 102, 241, 0.28), transparent 60%),
    radial-gradient(900px 500px at 85% 85%, rgba(37, 99, 235, 0.3), transparent 60%),
    radial-gradient(700px 400px at 70% 20%, rgba(139, 92, 246, 0.18), transparent 60%),
    linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #eff6ff 100%);
  padding: 20px;
}

.login-card {
  width: 400px;
  max-width: 94vw;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 38px 36px 30px;
  text-align: center;
}

.login-card h2 {
  margin: 10px 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
}

.login-card > p {
  margin: 0 0 24px;
  color: var(--gray-500);
  font-size: 15px;
}

.login-card .form-group { text-align: left; }
.login-card .btn { width: 100%; margin-top: 8px; padding: 11px; font-size: 15px; }

.login-error {
  color: var(--danger);
  font-size: 15px;
  text-align: center;
  margin-top: 14px;
  display: none;
  font-weight: 600;
}

.login-footer-text {
  text-align: center;
  color: var(--gray-400);
  font-size: 13.5px;
  margin-top: 22px;
}

.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row .form-control { flex: 1; }
.captcha-row img {
  width: 130px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  transition: border-color 0.2s;
  object-fit: cover;
  flex-shrink: 0;
}
.captcha-row img:hover { border-color: var(--primary); }

/* ============ 其他组件 ============ */
.gift-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.gift-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: var(--gray-50);
  border-radius: 10px;
  margin-bottom: 6px;
}

/* ──────────────────────────────────────────────────────────────
   [2026-09-13] 核销页「客户信息」面板里的赠送项目行
   原来这些行是裸 <div> + 内联样式，并且**继承了 #redSelected 上的
   .text-center**（那个类是给"请先搜索并选择客户"占位提示用的，
   但 selectCustomer() 是替换该容器的 innerHTML，类一直留着）。
   后果：项目名与说明文字全部居中；左侧文字块被挤到 115px，
   "剩余 24 次 · 有效期至 2028-12-31" 断成 3 行，日期断在 "2028-12-"。
   这里改为左对齐两栏：左栏自适应，右栏（数量框+按钮）定宽，
   这样每一行的输入框和按钮都对齐在同一条竖线上。
   ────────────────────────────────────────────────────────────── */
.gift-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-align: left;
}
.gift-item-main { flex: 1 1 190px; min-width: 0; text-align: left; }
.gift-item-name { font-size: 15px; font-weight: 700; color: #000; line-height: 1.45; }
.gift-item-info { font-size: 13.5px; font-weight: 600; color: #334155; line-height: 1.55; margin-top: 2px; }
.gift-item-info .nowrap { white-space: nowrap; }
.gift-item-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 168px;
  margin-left: auto;      /* 窄栏换行时，操作区仍靠右，不会跑到左边 */
}
.gift-item-actions .form-control { width: 68px; text-align: center; }
.gift-item-actions .btn { min-width: 84px; }
.gift-item-note { font-size: 13.5px; font-weight: 700; color: #c62828; white-space: nowrap; }

/* 最近核销 + 一键撤销：同样左对齐（原来也继承了 text-center） */
.last-redeem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  background: #fdf3e7;
  border-radius: 6px;
  text-align: left;
}
.last-redeem-text { font-size: 15px; font-weight: 600; color: #000; min-width: 0; }

.hover-card { transition: transform 0.15s, box-shadow 0.15s; }
.hover-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .col-3, .col-4, .col-6, .col-12 { grid-column: span 12; }

  .sidebar-collapse-btn { display: none; }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  body.sidebar-collapsed .sidebar-header { padding: 22px 20px 16px; }
  body.sidebar-collapsed .sidebar-header img { width: 58px; height: 58px; }
  body.sidebar-collapsed .sidebar-brand,
  body.sidebar-collapsed .sidebar-subtitle,
  body.sidebar-collapsed .sidebar-divider { display: block; }
  body.sidebar-collapsed .sidebar-nav { padding: 14px 12px; }
  body.sidebar-collapsed .sidebar-nav a { justify-content: flex-start; padding: 10px 13px; gap: 10px; }
  body.sidebar-collapsed .sidebar-nav a .icon { width: 20px; font-size: 15px; }
  body.sidebar-collapsed .sidebar-nav a .nav-text { display: inline; }
  body.sidebar-collapsed .sidebar-footer { padding: 14px 20px; text-align: left; }
  body.sidebar-collapsed .sidebar-foot-text { display: block; }
  body.sidebar-collapsed .sidebar-footer a { display: inline; font-size: 13.5px; margin-right: 12px; }
  body.sidebar-collapsed .main-content { margin-left: 0; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .content-wrap { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ============ 手机底部导航栏 ============ */
.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    min-height: 58px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
    z-index: 90;
  }

  .mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    font-size: 12.5px;
    color: var(--gray-500);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 12px;
    margin: 4px 2px;
    transition: background 0.15s, color 0.15s;
  }

  .mobile-nav a.active {
    color: var(--primary);
    font-weight: 700;
    background: var(--primary-50);
  }

  .mobile-nav a .mn-icon {
    font-size: 20px;
    line-height: 1;
  }

  .content-wrap {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============ 手机端细节优化（不影响电脑端） ============ */
@media (max-width: 900px) {
  /* 顶栏：窄屏压缩右侧用户信息 */
  .topbar { padding: 0 12px; }
  .topbar h4 { font-size: 15px; }
  .user-info { font-size: 13.5px; padding: 5px 10px; max-width: 45vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* 表格：触摸滑动更顺滑，首列固定方便看内容 */
  .table-wrap, .performance-table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap th, .table-wrap td,
  .performance-table-wrap th, .performance-table-wrap td { padding: 10px 12px; white-space: nowrap; }
  .table-wrap th:first-child, .table-wrap td:first-child,
  .performance-table-wrap th:first-child, .performance-table-wrap td:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    box-shadow: 1px 0 0 var(--gray-200);
  }
  .table-wrap thead th:first-child, .performance-table-wrap thead th:first-child { z-index: 2; }
  .table-wrap tbody tr:hover td:first-child, .performance-table-wrap tbody tr:hover td:first-child { background: var(--primary-50); }
  .table-wrap tbody tr:nth-child(even) td:first-child { background: var(--gray-50); }

  /* 弹窗：手机底部弹出式 */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    animation: slideUpSheet 0.22s ease;
  }
  .confirm-box {
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  @keyframes slideUpSheet {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }

  /* 表单：按钮加宽好按、输入框字号防 iOS 聚焦缩放 */
  .btn { min-height: 40px; }
  .form-control { font-size: 15px; }
  .filter-bar { grid-template-columns: 1fr; }
  .gift-row { flex-wrap: wrap; }
  .gift-row .form-control { min-height: 40px; }

  /* 登录页：适配小屏与底部安全区 */
  .login-page { padding: 16px; }
  .login-card { padding: 30px 22px calc(26px + env(safe-area-inset-bottom, 0px)); }
}

/* ============ 手机端独立的新增客户表单（全屏） ============ */
.mobile-form-overlay { display: none; }
.fab-add { display: none; }

@media (max-width: 900px) {
  .mobile-form-overlay.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--gray-100);
    z-index: 300;
  }

  .mobile-form-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
  }

  .mobile-form-back {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    font-size: 18px;
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-form-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
  }

  .mobile-form-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 130px;
  }

  .m-field { margin-bottom: 14px; }
  .m-field label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
  }
  .m-field .form-control {
    font-size: 15px;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 12px;
  }
  .m-field textarea.form-control { min-height: 84px; }

  .mobile-form-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 10px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--gray-200);
    z-index: 301;
  }
  .mobile-form-footer .btn { flex: 1; min-height: 46px; font-size: 15px; }

  .gift-row { flex-wrap: wrap; }
  .gift-row .form-control { min-height: 42px; }

  /* 客户页：按钮栏换行 + 隐藏次要列 + 悬浮新增按钮 */
  .customer-actions { flex-wrap: wrap; }
  .customer-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .customer-actions .btn { flex: 1 1 auto; }
  .customer-table th:nth-child(3),
  .customer-table td:nth-child(3),
  .customer-table th:nth-child(5),
  .customer-table td:nth-child(5),
  .customer-table th:nth-child(8),
  .customer-table td:nth-child(8) { display: none; }
  /* 操作列固定在右侧，续购等按钮随时可见 */
  .customer-table th:last-child,
  .customer-table td:last-child {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 1;
    box-shadow: -1px 0 0 var(--gray-200);
  }
  /* [2026-10-16] 小屏：操作列空间有限，按钮允许换行并等分，避免挤出屏幕 */
  .row-actions { flex-wrap: wrap; gap: 5px; max-width: 132px; }
  .row-actions .row-act { min-width: 0; flex: 1 1 calc(50% - 3px); font-size: 12.5px; padding: 5px 6px; }
  .customer-table thead th:last-child { z-index: 2; }
  .customer-table tbody tr:hover td:last-child { background: var(--primary-50); }
  .customer-table tbody tr:nth-child(even) td:last-child { background: var(--gray-50); }

  .fab-add {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 28px;
    line-height: 1;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    cursor: pointer;
    z-index: 85;
    -webkit-tap-highlight-color: transparent;
  }
  .fab-add:active { transform: scale(0.94); }
}
/* ??????????????????????? */
.customer-actions { flex-wrap: wrap; }

/* ????/????????????????? */
.performance-stat-table thead th { text-align: center; }
.performance-stat-table thead th:first-child,
.performance-stat-table thead th:nth-child(2) { text-align: left; }
.performance-stat-table thead th:nth-child(2) { padding-left: 62px; }
.sales-stat-table thead th { text-align: center; }
.sales-stat-table thead th:first-child { text-align: left; padding-left: 62px; }
.performance-stat-table tbody td { text-align: center; }
.performance-stat-table tbody td:first-child,
.performance-stat-table tbody td:nth-child(2) { text-align: left; }
.sales-stat-table tbody td { text-align: center; }
.sales-stat-table tbody td:first-child { text-align: left; }

/* ============ ????????? ============ */
/* 仪表盘分布卡片等高并排 */
.chart-card { height: 100%; display: flex; flex-direction: column; }
.chart-card .card-body { flex: 1; }

/* 等高卡片（核销页等双栏并排） */
.card-fill { height: 100%; display: flex; flex-direction: column; }
.card-fill .card-body { flex: 1; }


/* ============ 凭证 / 打印 ============ */
#printArea { display: none; }

.voucher-preview {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.voucher {
  font-family: var(--font);
  border: 2px solid #1e293b;
  border-radius: 8px;
  padding: 18px 20px;
  background: #fff;
  max-width: 420px;
}

.v-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 1px;
  border-bottom: 1px dashed var(--gray-300);
  padding-bottom: 8px;
}

.v-grid { display: flex; flex-wrap: wrap; }

.v-field {
  width: 50%;
  display: flex;
  padding: 5px 0;
  font-size: 15px;
  box-sizing: border-box;
  align-items: baseline;
}

.v-field.v-full { width: 100%; }
.v-field label { color: #64748b; width: 76px; flex-shrink: 0; }
.v-field span { color: #0f172a; font-weight: 600; }
.v-gifts { line-height: 1.7; }

.v-sign {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed #94a3b8;
  font-size: 15px;
  text-align: right;
}

@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  .voucher {
    max-width: none;
    border: 2px solid #000;
    margin: 0;
  }
  .v-field label, .v-field span, .v-title, .v-sign { color: #000; }
  @page { margin: 10mm; }
}

.customer-cards { display: none; }

@media (max-width: 900px) {
  .customer-table-wrap { display: none; }
  .customer-cards { display: block; }

  .cust-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
  }

  .cust-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }

  .cust-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cust-card-type {
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    padding: 3px 10px;
    border-radius: 999px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cust-card-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 15px;
    color: var(--gray-700);
    padding: 3px 0;
    word-break: break-all;
  }

  .cust-card-row > span:first-child {
    flex-shrink: 0;
    width: 44px;
    color: var(--gray-500);
    font-size: 13.5px;
  }

  .cust-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--gray-200);
  }

  .cust-card-actions .btn {
    flex: 1;
    min-height: 38px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   [2026-09-13] 可读性增强：正文改纯黑 + 整体加粗一档
   起因：有同事近视，原来的灰蓝正文（#1e293b）和小号浅灰看不清。

   做法与边界（重要）：
   · 只动「文字色」相关的灰阶变量。已逐一核对用法 ——
       gray-400 / 500 / 600 / 700 / 800 在整份样式表里**只用作 color**，
       共 40 处；而 gray-200 / 300 只用于边框与底色，**完全不动**，
       所以不会把表格线、分隔线一起变黑。
   · 正文由「继承」改为显式 #000，字重由默认 400 提到 500（medium）。
       标题/表头原本就是 600~800，不受影响，层级仍在。
   · 小字（small / .mini / .text-muted）最容易看不清，额外再加一档到 600。
   ══════════════════════════════════════════════════════════════════ */
:root {
  /* 文字专用灰阶：原来偏浅，全部压深。层级仍保留（400 最浅 → 700/800 纯黑） */
  --gray-400: #3f3f46;
  --gray-500: #27272a;
  --gray-600: #18181b;
  --gray-700: #000000;
  --gray-800: #000000;
}

body {
  color: #000;              /* 纯黑正文 */
  font-weight: 500;         /* 默认 400 → 500，整体加粗一档 */
}

/* 小号文字最容易看不清，再加一档 */
small,
.mini,
.text-muted {
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────
   [2026-09-13 修正] 表单控件与按钮的字体族
   问题：<button>/<input>/<select>/<textarea> 按浏览器规则**不继承**
   font-family，只有挂了 .btn / .form-control 的才显式设了字体。
   于是老板看板、操作日志等处 24 个"裸按钮"回落成浏览器默认 Arial，
   中文旁的数字与标点（如"近7天"的 7）字形和正文对不上 —— 看着"怪"。
   ────────────────────────────────────────────────────────────── */
button,
input,
select,
textarea,
.btn {
  font-family: var(--font);
  /* 兜底字号：<button>/<input> 既不继承字体族，也不继承字号 ——
     不写这一条就会落回浏览器默认的 13.3333px。
     核销记录页的分页按钮（首页/‹/1/2/›/末页）曾是全站唯一漏网的。 */
  font-size: 15px;
}

.pagination button {
  font-size: 13.5px;        /* 与 .btn-sm 的分页按钮保持一致 */
  font-weight: 600;
}

/* 表格正文与输入控件加粗到 500；注意**不含 .btn / button** ——
   上一版把它们一起压成 500，而 .btn 基类本来是 600，等于把按钮改细了。 */
table td,
input,
select,
textarea {
  font-weight: 500;
}

button,
.btn {
  font-weight: 600;         /* 按钮维持 600，不被上面的规则压细 */
}

table th {
  font-weight: 700;         /* 表头再稳一点 */
}

/* ── 深色区域同样照顾可读性 ──
   侧边栏是深底，文字原本是半透明白（0.55~0.82），在深底上发虚。
   一并改为实白并加粗一档；只影响深色区域，浅色区域不受影响。 */
.sidebar,
.sidebar-brand,
.sidebar-nav a,
.sidebar-nav .nav-item,
.sidebar-footer,
.sidebar-header {
  font-weight: 600;
}
.sidebar { color: #fff; }
.sidebar-nav a,
.sidebar-nav .nav-item { color: rgba(255, 255, 255, 0.95); }
.sidebar-nav a:hover,
.sidebar-nav .nav-item:hover,
.sidebar-nav a.active,
.sidebar-nav .nav-item.active { color: #fff; }

/* ══════════════════════════════════════════════════════════════════
   [2026-09-14 修复] 详情弹窗里的字段标签太拥挤。

   症状：详情弹窗里 14 个字段挤成一片 —— 标签（姓名：/电话：…）宽度不统一、
   和值贴在一起，值也不对齐；两列之间只有 20px，看着很闷。

   根因：字段的写法是 <div class="col-6"><strong>姓名：</strong>值</div>，
   strong 是行内元素、宽度随文字变，标签和值之间没有任何间距规则。
   ══════════════════════════════════════════════════════════════════ */
.modal-content .row > [class^="col-"] > strong:first-child {
  display: inline-block;
  min-width: 5.6em;                 /* 标签定宽 —— 所有值左对齐 */
  color: var(--gray-500);
  font-weight: 600;
  margin-right: 4px;                /* 标签与值之间留出呼吸 */
}
/* 弹窗里的行：行间距放开，列间距也加大 */
.modal-content .row { gap: 14px 28px; }
.modal-content .row.mb-3 { margin-bottom: 16px; }
/* 值本身给一点行高，避免换行时挤在一起（如备注） */
.modal-content .row > [class^="col-"] { line-height: 1.7; overflow-wrap: anywhere; }
/* 弹窗略加宽，两列才不局促 */
.modal-content { max-width: 620px; }
/* 底部按钮条是 sticky 的，滚动到末尾时会盖住最后一行内容 —— 给内容留出让位 */
.modal-content > :last-child:not(.modal-actions) { margin-bottom: 4px; }
.modal-actions { padding-bottom: 2px; }

/* [2026-09-21] 统一工具条：筛选条件一组、操作按钮一组，同处一个框内
   条件组内部绝不换行；按钮组放不下时整组落到第二行并右对齐 */
.tb-filters { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 10px; flex: 1 1 1400px; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.tb-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; padding-left: 2px; }
.tb-actions .btn { min-height: 36px; padding: 8px 14px; font-size: 14px; white-space: nowrap; }

/* [2026-09-19] 查询条：始终排成一行（窄屏横向滑动，不换行） */
.rec-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
}
.rec-bar .form-group { margin-bottom: 0; min-width: 0; flex: 0 0 auto; }
.rec-bar .form-label { font-size: 12.5px; font-weight: 500; color: var(--gray-500); margin-bottom: 4px; white-space: nowrap; }
.rec-bar .form-control { font-size: 14px; padding: 7px 8px; min-height: 34px; }
/* 与客户管理同一套尺寸，两个页面观感一致 */
.rec-bar .g-text { flex: 1 1 150px; min-width: 90px; max-width: 190px; }
.rec-bar .g-sel { flex: 1 1 124px; min-width: 82px; max-width: 160px; }
.rec-bar .g-sel-wide { flex: 1 1 155px; min-width: 100px; max-width: 200px; }
.rec-bar .g-date { flex: 0 1 130px; min-width: 98px; max-width: 150px; }
.rec-bar .rec-actions { display: flex; gap: 8px; align-items: flex-end; flex: 0 0 auto; margin-left: auto; padding-left: 4px; }
.rec-bar .rec-actions .btn { min-height: 34px; padding: 7px 12px; font-size: 14px; white-space: nowrap; }

.customer-toolbar { display: flex; flex-wrap: wrap; gap: 10px 8px; align-items: flex-end; padding: 12px 16px; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: visible; }
.customer-toolbar .cf { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 0 0 auto; }
.customer-toolbar .cf > label { font-size: 12.5px; color: var(--gray-500); font-weight: 500; white-space: nowrap; }
.customer-toolbar .form-control { min-height: 36px; font-size: 14px; padding: 8px 10px; }
/* 搜索框可伸缩（最常用，给最宽）；下拉按内容给舒适定宽，不再拉伸填满整行 */
/* 统一尺寸：同类控件同宽（活动类型和支付方式都是普通下拉，宽度一致）
   宽屏长到上限、窄屏收到下限，条件绝不换行 */
.customer-toolbar .cf-text { flex: 1 1 150px; min-width: 96px; max-width: 190px; }
.customer-toolbar .cf-sel { flex: 1 1 130px; min-width: 84px; max-width: 168px; }
.customer-toolbar .cf-sel-wide { flex: 1 1 160px; min-width: 100px; max-width: 208px; }
.customer-toolbar .cf-date { flex: 0 1 132px; min-width: 98px; max-width: 150px; }
/* 搜索框放最后，才能盖住上面的 .cf-text（同权重，后写的生效） */
.customer-toolbar .cf-grow { flex: 1 1 200px; min-width: 140px; max-width: 240px; }
.customer-toolbar .cf-check { display: flex; flex-direction: row; align-items: center; gap: 6px; min-height: 36px; flex: 0 0 auto; white-space: nowrap; }
.customer-toolbar .cf-check label { font-size: 12.5px; color: var(--gray-700); cursor: pointer; white-space: nowrap; margin: 0; }
.customer-toolbar .cf-btns { display: flex; gap: 8px; align-items: flex-end; flex: 0 0 auto; }
.customer-toolbar .cf-btns .btn { min-height: 36px; padding: 8px 14px; font-size: 14px; white-space: nowrap; }


@media (min-width: 1180px) and (max-width: 1439px) {
  :root { --sidebar-w: 180px; }
}
@media (max-width: 1179px) {
  /* 条件组不换行；整条工具条允许按钮组落到第二行 */
  .rec-bar, .customer-toolbar { flex-wrap: wrap; }
  .rec-bar .tb-filters, .customer-toolbar .tb-filters { flex-wrap: nowrap; overflow-x: auto; }
}


/* ============================================================
   [2026-09-21] 手机端修复（真机尺寸实测出来的）
   1) 客户管理/核销记录的筛选区在手机上被撑到 1400px 高：
      .tb-filters 的 flex-basis 是给"一行"用的 1400px，
      而手机端 .customer-toolbar 变成了 flex-direction:column ——
      竖向容器里 flex-basis 就变成了**高度**，于是筛选区凭空占 1400px，
      客户列表被顶到第 2 屏之后，等于一进页面什么都看不到。
      → 改成两列网格，高度由内容决定。
   2) 顶栏在 390px 下塞不下，标题和配色按钮都被挤成两行。
   ============================================================ */
@media (max-width: 900px) {
  .customer-toolbar,
  .rec-bar { flex-direction: column; align-items: stretch; }

  /* 筛选条件：两列网格；关键词/勾选/按钮独占整行 */
  .customer-toolbar .tb-filters,
  .rec-bar .tb-filters {
    flex: 0 0 auto;                 /* 关键：不再用 1400px 的 flex-basis */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    overflow: visible;
    align-items: stretch;
  }
  .customer-toolbar .tb-filters > *,
  .rec-bar .tb-filters > * { flex: none; width: auto; min-width: 0; max-width: none; }
  .customer-toolbar .tb-filters > .cf-grow,
  .customer-toolbar .tb-filters > .cf-check,
  .customer-toolbar .tb-filters > .cf-btns,
  .rec-bar .tb-filters > .rec-actions { grid-column: 1 / -1; }

  /* 操作按钮：自动换行、撑满 */
  .customer-toolbar .tb-actions,
  .rec-bar .tb-actions { flex-wrap: wrap; margin-left: 0; width: 100%; }
  .customer-toolbar .tb-actions .btn,
  .rec-bar .tb-actions .btn { flex: 1 1 auto; }

  /* 输入框统一 16px，避免 iOS 聚焦放大整页 */
  .customer-toolbar .form-control,
  .rec-bar .form-control,
  .filter-bar .form-control { font-size: 16px; }

  /* 顶栏：标题不换行、配色按钮只留图标、用户信息截断 */
  .topbar { gap: 8px; }
  .topbar h4 {
    font-size: 15px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 42vw;
  }
  .topbar > div:first-child { min-width: 0; flex: 1 1 auto; }
  .topbar > div:last-child { flex: 0 0 auto; }
  .skin-cyc { padding: 7px 10px; min-height: 38px; white-space: nowrap; }
  .skin-cyc span { display: none; }
  .topbar .user-info {
    max-width: 24vw; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-size: 13px;
  }

  /* 核销记录：12 列的宽表在手机上宽 1537px，要横向拖 1200px 才够到"操作"。
     这里砍掉次要列（活动类型/套餐/操作员/门店/备注），只留：
     ID · 客户 · 赠送项目 · 核销数量 · 车牌号 · 核销时间 · 操作 */
  .rec-table th:nth-child(3),  .rec-table td:nth-child(3),
  .rec-table th:nth-child(4),  .rec-table td:nth-child(4),
  .rec-table th:nth-child(7),  .rec-table td:nth-child(7),
  .rec-table th:nth-child(8),  .rec-table td:nth-child(8),
  .rec-table th:nth-child(10), .rec-table td:nth-child(10) { display: none; }
  .rec-table th, .rec-table td { padding: 10px 12px; }
}


/* ============================================================
   [2026-09-21] 手机端第二步：核销记录卡片视图 + 筛选条件默认收起
   ============================================================ */
.m-filter-toggle { display: none; }

.rec-cards { display: none; }

@media (max-width: 900px) {
  /* 核销记录：手机上不再用 12 列表格（要横向拖 800px），改卡片 */
  .rec-table-wrap { display: none; }
  .rec-cards { display: block; }

  /* 筛选条件默认收起：一进页面先看到列表，点「筛选条件」再展开 */
  .m-filter-toggle {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; min-height: 44px; margin-bottom: 4px;
    font-size: 15px; font-weight: 600;
    border: 1px solid var(--gray-200); border-radius: 10px;
    background: #fff; color: var(--gray-700);
  }
  .customer-toolbar .tb-filters,
  .rec-bar .tb-filters { display: none; }
  .customer-toolbar.filters-open .tb-filters,
  .rec-bar.filters-open .tb-filters { display: grid; }
}


/* ============================================================
   [2026-09-21] 手机端触控与字号（真交互实测出来的）
   实测：核销操作页搜索框 15px -> iOS 聚焦会放大整页；
        搜索按钮 62x35 -> 低于 44px 触控标准，手指容易点偏。
   ============================================================ */
@media (max-width: 900px) {
  /* iOS 只在输入控件字号 < 16px 时聚焦自动放大整页，全站统一 16px */
  input, select, textarea { font-size: 16px !important; }
  /* 触控目标：主按钮按安卓 Material 标准 48px，次要按钮/分页 44px。
     必须 !important：皮肤文件（skin-apple/skin-warm）在 style.css 之后加载，
     且有 body.skin-apple:not([data-palette="warm"]) .btn-sm { min-height:35px }
     这种高优先级规则，普通写法压不住（实测这就是按钮一直 35px 的原因）。
     min-height 是下限，本来更高的按钮不会被压矮。 */
  .btn { min-height: 48px !important; }
  .btn-sm, .menu-toggle { min-height: 44px !important; }
  /* 分页按钮是裸 <button>（没有 .btn 类），实测只有 34px，单独补 */
  .pagination button { min-height: 44px !important; min-width: 44px; font-size: 14px; }
  /* 底部标签栏 fixed、实测高 66px，而皮肤 skin-apple.css:69 的
     body.skin-apple:not([data-palette="warm"]) .content-wrap { padding: 26px 26px 52px }
     优先级更高且后加载，只留 52px —— 最后一条会被盖住 14px。
     这里用 !important 压过皮肤，留 84px（66 + 余量）。 */
  .content-wrap { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
  .menu-toggle { min-width: 44px; min-height: 44px; }
  .skin-cyc { min-height: 44px; }
}


/* ══════════════════════════════════════════════════════════════
   [2026-10-16] 客户页工具栏瘦身：一行搞定
   原来 14 个控件铺两行（搜索+5下拉+2日期+2勾选+5按钮），最挤的地方就在这里。
   现在：搜索 + 筛选▾ + 查询 + 重置 + 新增客户 + 更多▾ = 一行；
        其余筛选收进可展开面板，导出/导入/归档收进更多菜单。
   ══════════════════════════════════════════════════════════════ */
.customer-toolbar.tb-slim {
  display: block;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.tb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-row .tb-search { flex: 1 1 220px; min-width: 160px; min-height: 36px; font-size: 14px; }
.tb-row .btn { min-height: 36px; padding: 8px 14px; font-size: 14px; white-space: nowrap; }
.tb-badge {
  display: none; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; margin-left: 6px; padding: 0 4px;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 1;
}
.tb-caret { font-style: normal; margin-left: 5px; font-size: 11px; opacity: .6; }
#btnFilterToggle.open .tb-caret { transform: rotate(180deg); display: inline-block; }

.tb-more-wrap { position: relative; }
.tb-more {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 150px; padding: 5px;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  flex-direction: column; align-items: stretch;
}
.tb-more.open { display: flex; }
.tb-more > span { display: block; }
.tb-more button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; background: transparent; border-radius: 7px;
  font-size: 13.5px; font-family: var(--font); color: var(--gray-700); cursor: pointer;
}
.tb-more button:hover { background: var(--gray-100); }
.tb-more button.danger { color: #b91c1c; }
.tb-more button.danger:hover { background: #fef2f2; }

.tb-panel { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gray-200); }
.tb-panel.open { display: block; }
.tb-panel-grid {
  display: grid; gap: 10px 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}
.tb-panel .cf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tb-panel .cf > label { font-size: 12.5px; color: var(--gray-500); font-weight: 500; white-space: nowrap; }
.tb-panel .form-control { min-height: 36px; font-size: 14px; padding: 8px 10px; width: 100%; }
.tb-panel .cf-check { display: flex; flex-direction: row; align-items: center; gap: 6px; min-height: 36px; white-space: nowrap; }
.tb-panel .cf-check label { font-size: 13px; color: var(--gray-700); cursor: pointer; margin: 0; }
.tb-panel-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tb-hint { font-size: 12.5px; color: var(--gray-400); margin-left: 4px; }


/* ══════════════════════════════════════════════════════════════
   [2026-10-16] 客户管理页美化 v2 —— 主题自适应 + 排版细节
   三种皮肤（原样式/深色/暖白）都提供语义变量：
     --bg-card 卡片底 / --bg-elev 浮层底 / --label·--label2·--label3 文字层级
     --sep 分隔线 / --primary 主色
   这里统一改用变量，替换此前为排查问题而写的硬编码白色与灰阶。
   ══════════════════════════════════════════════════════════════ */

/* —— 工具栏：圆角卡 + 柔阴影 + 舒展内边距 —— */
.customer-toolbar.tb-slim {
  padding: 14px 16px;
  background: var(--bg-elev, var(--gray-50));
  border: 1px solid var(--sep, var(--gray-200));
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, none);
  margin-bottom: 14px;
}
.tb-row { gap: 10px; }
.tb-row .tb-search {
  min-height: 40px; font-size: 14.5px; padding: 8px 14px;
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-card, #fff); color: var(--label, var(--gray-800));
  border: 1px solid var(--sep, var(--gray-300));
}
.tb-row .tb-search::placeholder { color: var(--label3, var(--gray-400)); }
.tb-row .btn { min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm, 9px); }
.tb-view-switch { margin-left: auto; }
.tb-view-switch button { padding: 6px 14px; color: var(--label2, var(--gray-600)); background: var(--bg-card, #fff); }
.tb-view-switch button.active { background: var(--primary-50, #eef2ff); color: var(--primary-dark, var(--primary)); }
.view-switch { border-color: var(--sep, var(--gray-300)); }

/* —— 浮层（更多菜单 / 行内菜单 / 筛选面板）—— */
.tb-more, .row-more {
  background: var(--bg-elev, #fff);
  border: 1px solid var(--sep, var(--gray-200));
  box-shadow: var(--shadow-lg, 0 10px 28px rgba(15,23,42,.16));
}
.tb-more button, .row-more button { color: var(--label, var(--gray-700)); }
.tb-more button:hover, .row-more button:hover { background: var(--primary-50, var(--gray-100)); }
.tb-more button.danger, .row-more button.danger { color: var(--danger, #b91c1c); }
.tb-panel { border-top-color: var(--sep, var(--gray-200)); }
.tb-hint { color: var(--label3, var(--gray-400)); }
.tb-badge { background: var(--primary, #4f46e5); }

/* —— 表头：更轻的字重 + 一条底部分界线，减少"表格感" —— */
.customer-table thead th {
  font-weight: 500;
  letter-spacing: .2px;
  color: var(--label2, var(--gray-500));
  border-bottom: 1px solid var(--sep, var(--gray-200));
  padding: 12px 16px;
}
.customer-table tbody td { padding: 13px 16px; }
.customer-table tbody tr:hover { background: var(--primary-50, rgba(79,70,229,.04)); }

/* —— 套餐徽标：克制的浅底描边胶囊（原来大块饱和色，整列发花）—— */
.customer-table tbody td .badge,
.rec-table tbody td .badge {
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
}
/* 套餐名（pkgBadge 生成的是带左侧色条的行内块）：收窄 + 轻底 */
.customer-table td span[style*="border-left"] {
  padding: 3px 10px 3px 8px !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  border-radius: 0 999px 999px 0;
  background: var(--bg-card, #fff);
}

/* —— 今日续购 / 份数徽标：轻量描边 —— */
.customer-table td span[style*="background:#ffedd5"],
.customer-table td span[style*="background:#eef2ff"] {
  padding: 2px 9px !important;
  font-size: 12.5px !important;
  border-radius: 999px;
}

/* —— 赠送概况：项目之间用细点分隔，不再靠竖线硬拼 —— */
.customer-table td:nth-child(8) { font-size: 13.5px; color: var(--label2, var(--gray-600)); line-height: 1.7; }

/* —— 行内操作按钮：更接近"按钮"而不是纯文字 —— */
.row-actions .row-act {
  min-width: 56px; padding: 5px 12px;
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-card, #fff);
  border-color: var(--sep, var(--gray-300));
  color: var(--label, var(--gray-700));
  transition: all .15s ease;
}
.row-actions .row-act:hover { background: var(--primary-50, transparent); border-color: var(--primary, var(--gray-400)); color: var(--primary-dark, var(--primary)); }
.row-actions .row-act-key { background: var(--bg-card, #faf5ff); border-color: var(--purple, #8b5cf6); color: var(--purple, #6d28d9); }
.row-actions .row-act-key:hover { background: var(--primary-50, #f3e8ff); }
.row-actions .row-act-more { min-width: 40px; font-weight: 700; color: var(--label2, var(--gray-600)); }

/* —— 警示横幅：收敛一点，不抢表格的视线 —— */
.dup-warn, .alert-warn, .customer-warn {
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 10px);
}


/* ══════════════════════════════════════════════════════════════
   [2026-10-16] 客户页美化 v3：套餐徽标瘦身
   pkgBadge() 是全局函数（单据/核销等页面共用），不改它本身；
   这里只在客户列表里覆盖成"轻量胶囊"：浅底 + 同色描边 + 左侧色条。

   实现要点（第一版踩过的坑）：徽标文字是白色、主色在 background 上，
   所以描边/底色必须从 **元素自身的 background-color** 派生，
   不能用 currentColor —— 那会把文字算成近透明，整块徽标看不见了。
   ══════════════════════════════════════════════════════════════ */
.customer-table td:nth-child(4) span[style] {
  padding: 3px 12px !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  line-height: 1.9 !important;
  border-radius: 999px !important;
  /* 1px 描边 = 原主色；浅底 = 原主色混入卡片底色。文字改深色 + 左侧粗色条保留识别度 */
  border: 1px solid var(--pkg-c, #94a3b8) !important;
  background: color-mix(in srgb, var(--pkg-c, #94a3b8) 12%, var(--bg-card, #fff)) !important;
  color: var(--label, #1f2937) !important;
  box-shadow: inset 5px 0 0 0 var(--pkg-c, #94a3b8);
}
/* 徽标内的"套数"块：分隔线跟着主色淡化 */
.customer-table td:nth-child(4) span[style] span {
  margin-left: 8px !important;
  padding-left: 8px !important;
  border-left: 1px solid color-mix(in srgb, var(--pkg-c, #94a3b8) 45%, transparent) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  opacity: .9;
}

/* —— 表头更轻 —— */
.customer-table thead th { font-size: 13px; }

/* —— 警示横幅：字号与配色收敛，别抢表格 —— */
.dup-warn, .alert-warn, [class*="warn"] {
  font-size: 13.5px !important;
  line-height: 1.6;
  border-radius: var(--radius-sm, 10px) !important;
}
