
/* 📅 Unified Appointment Action Buttons */
.btn-apt-action {
  height: 32px !important;
  font-size: 0.78rem !important;
  padding: 0 0.65rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  transition: all 0.2s ease !important;
}
.btn-wa-outline {
  background: rgba(37, 211, 102, 0.1) !important;
  border: 1px solid #25D366 !important;
  color: #15803d !important;
}
.btn-wa-outline:hover {
  background: rgba(37, 211, 102, 0.2) !important;
  color: #166534 !important;
}
.btn-wa-solid {
  background: #25D366 !important;
  border: 1px solid #22c55e !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25) !important;
}
.btn-wa-solid:hover {
  background: #1eb954 !important;
  color: #ffffff !important;
}


.appointment-card-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1rem;
  align-items: center;
}
.apt-time-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.apt-info-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.apt-actions-col {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  max-width: 350px;
}

/* ==========================================================================
   裕美造型/美容院 POS 系统 - 极奢黑金/玫瑰金 UI 规范样式表
   Yumei Studio Co POS System - Dark Luxury Beauty Salon CSS Theme
   ========================================================================== */

:root {
  /* 品牌调色盘 (Light Blue & White Theme) */
  --bg-deep: #f4efe9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;

  /* 主色调 - 浅蓝色系 */
  --gold-primary: #8b5cf6;
  
  --gold-gradient: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  
  --rose-gradient: linear-gradient(135deg, #fbcfe8 0%, #ec4899 100%);
  
  /* 辅助与状态色 */
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* 文字颜色 */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-dim: #64748b;
  --text-gold: #ffffff;
  --text-inverse: #ffffff;

  /* 边框与阴影 */
  --border-light: #e2e8f0;
  --border-dark: #cbd5e1;
  --border-gold: rgba(139, 92, 246, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
  --shadow-gold: 0 0 20px rgba(14, 165, 233, 0.2);

  /* 尺寸与圆角 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --sidebar-width: 300px;
}

:root.theme-dark {
  /* Dark Theme Colors */
  --bg-deep: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;

  /* Keep brand colors mostly the same but maybe a bit brighter */
  --gold-primary: #a78bfa;

  /* Dark mode text should be light */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-gold: #ffffff;
  --text-inverse: #1e293b;

  /* Dark mode borders should be darker */
  --border-light: #334155;
  --border-dark: #475569;
  
  /* Dark mode shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* 全局重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
}

  /* ==========================================================================
     全局滚动条美化 (Modern Cross-Browser Scrollbar)
     ========================================================================== */
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
  }
  
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3); /* Theme purple */
    border-radius: 10px;
    border: 2px solid var(--bg-surface, #fff); /* Creates a floating effect */
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
  }

  /* ==========================================================================
     Bulletproof Alignment Rules (Migrated from admin.html)
     ========================================================================== */
  .view-container {
      padding: 1rem 1.25rem 2rem 1.25rem !important;
      box-sizing: border-box !important;
  }
  .top-header,
  .module-view,
  .system-panel,
  .system-panel > .glass-card,
  #system-panel-reports > div {
      width: auto !important;
      max-width: 100% !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
      box-sizing: border-box !important;
  }
  .top-header { border-radius: 32px !important; }
  .system-panel > .glass-card { border-radius: 32px !important; }

/* ==========================================================================
   布局结构 (App Layout)
   ========================================================================== */

#app {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 侧边导航栏 (Sidebar) */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  max-height: 100vh;
  box-sizing: border-box;
  background: transparent;
  border: none;
  display: flex;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;

  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem 0.5rem;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar > div:first-child {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.2rem;
  flex-shrink: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: var(--gold-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: 800;
  box-shadow: var(--shadow-gold);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.nav-menu::-webkit-scrollbar {
  width: 4px;
}
.nav-menu::-webkit-scrollbar-track {
  background: transparent;
}
.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}
.nav-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.nav-item {
  display: flex;
  margin: 3px 6px;
  border-radius: 12px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.nav-item i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--gold-gradient);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.nav-item.active i {
  color: #ffffff;
}

.nav-category-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-primary);
  padding: 0.6rem 0.8rem 0.2rem 0.8rem;
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.85;
}

.nav-subitem {
  padding-left: 2rem !important;
  font-size: 0.88rem !important;
}

/* 底部店铺/快捷信息 */
.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.online-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

.online-dot.offline-dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* 主内容区域 (Main Content Area) */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  background: var(--bg-surface);
  border-radius: 32px;
  margin: 12px 12px 12px 0;
  box-shadow: -8px 0 20px rgba(0,0,0,0.02);
  overflow-y: auto;
  overflow-x: hidden;
  flex-direction: column;
  height: calc(100vh - 24px);
  }

/* 顶部 Header */
.top-header {
  border-radius: 20px;
  margin: 0.75rem 0 1rem 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  height: 60px;
  min-height: 60px;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.15rem;
  flex-shrink: 0;
  gap: 0.75rem;
  overflow: hidden;
}

.header-title-group {
  min-width: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
}
.header-title-group h2,
#global-header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
  line-height: 1.2;
}
.header-title-group p,
#global-header-slogan {
  display: none !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
  min-width: 0;
}

.header-current-user {
  margin-right: 0 !important;
  font-weight: 600;
  color: var(--gold-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.18);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 170px;
}
.header-current-user i {
  font-size: 1rem;
  flex-shrink: 0;
}
.header-username-text {
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}
.header-logout-btn {
  padding: 0.2rem 0.45rem;
  margin-left: 0.25rem;
  font-size: 0.72rem;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.15);
  border: none;
  color: var(--gold-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.header-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.system-clock {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-primary);
  background: rgba(139, 92, 246, 0.08);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-gold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.btn-header {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 32px;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-header:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--gold-primary);
}

@media screen and (max-width: 1200px) {
  .btn-header .btn-header-text {
    display: none !important;
  }
  .system-clock {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
}

/* 动态模块视图容器 */
.view-container {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.25rem 2rem 1.25rem;
    position: relative;
}

.module-view {
  display: none;
  /* animation removed for sticky */
}

.module-view.active { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   通用的卡片与按钮组件 (UI Cards & Buttons)
   ========================================================================== */

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 32px;
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.glass-card:hover {
  border-color: var(--border-gold);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 按钮规范 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  outline: none;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.btn-rose {
  background: var(--rose-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}
.btn-rose:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

/* 表单输入控件 */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.25);
}

select.form-control option {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

/* Badge 胶囊标识 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-vip { background: rgba(139, 92, 246, 0.15); color: var(--gold-primary); border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-gold { background: rgba(245, 158, 11, 0.15); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-silver { background: rgba(148, 163, 184, 0.15); color: #475569; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge-normal { background: rgba(0, 0, 0, 0.05); color: #475569; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #047857; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==========================================================================
   1. 消费收银台模块 (Cashier View Layout)
   ========================================================================== */

.cashier-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1rem;
  flex: 1; min-height: 0;
}

.cashier-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

/* 顶部选择会员与分类筛选 */
.cashier-top-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.member-search-box {
  flex: 1;
  position: relative;
}

.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.pill-item {
  padding: 0.45rem 1rem;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.pill-item.active, .pill-item:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* 商品项目网格列表 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  align-content: start;
  overflow-y: auto;
  padding-right: 0.3rem;
  flex: 1;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-gold);
}

.product-card.out-of-stock {
  opacity: 0.72;
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: rgba(239, 68, 68, 0.03) !important;
}

.product-card.out-of-stock:hover {
  transform: none !important;
  border-color: #ef4444 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

.product-tag {
  font-size: 0.7rem;
  color: var(--gold-primary);
  background: rgba(139, 92, 246, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-md);
  align-self: flex-start;
  margin-bottom: 0.4rem;
}

/* 🌟 Modern Product Card Badges & Categories */
/* 🌟 Modern Product Card Badges & Categories */
.product-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 0.45rem;
  min-height: 24px;
  width: 100%;
}

.product-category-pill {
  font-size: 0.69rem;
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  padding: 2.5px 8px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

[data-theme="dark"] .product-category-pill,
.dark .product-category-pill,
.theme-dark .product-category-pill {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.28);
}

.badge-multi-options {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(217, 119, 6, 0.12) 100%);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.28);
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.08);
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-multi-options i {
  font-size: 0.72rem;
  color: #7c3aed;
}

[data-theme="dark"] .badge-multi-options,
.dark .badge-multi-options,
.theme-dark .badge-multi-options {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.4);
}

[data-theme="dark"] .badge-multi-options i,
.dark .badge-multi-options i,
.theme-dark .badge-multi-options i {
  color: #fbbf24;
}

.badge-limit-one {
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(244, 63, 94, 0.12) 100%);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: 0 1px 3px rgba(225, 29, 72, 0.08);
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-limit-one i {
  font-size: 0.72rem;
  color: #e11d48;
}

[data-theme="dark"] .badge-limit-one,
.dark .badge-limit-one,
.theme-dark .badge-limit-one {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(244, 63, 94, 0.22) 100%);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.45);
}

[data-theme="dark"] .badge-limit-one i,
.dark .badge-limit-one i,
.theme-dark .badge-limit-one i {
  color: #fda4af;
}

.badge-stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2.5px 7.5px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  white-space: nowrap;
  line-height: 1.2;
}

.badge-stock-pill i {
  font-size: 0.7rem;
}

.product-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-top: 0.2rem;
  margin-bottom: 0.35rem;
  display: block;
  word-break: break-word;
}

.product-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
  gap: 0.5rem;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-primary);
}

.product-stock {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* 收银台右侧：购物车与结算单 (Cart Panel) */
.cashier-right {
  background: var(--bg-surface);
  border: none;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: calc(100vh - 130px); /* Fixed height so button stays visible */
  max-height: calc(100vh - 130px);
  position: sticky;
  top: 10px;
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.cart-header {
  padding: 0.7rem 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.active-member-info {
  background: rgba(14, 165, 233, 0.08);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.8rem;
  margin: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem;
  min-height: 60px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-item-info {
  flex: 1;
  padding-right: 0.5rem;
}

.cart-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.cart-item-sub {
  font-size: 0.75rem;
  color: var(--gold-primary);
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-qty {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.cart-qty-num {
  font-size: 0.85rem;
  font-weight: 700;
  width: 22px;
  text-align: center;
}

/* 结算汇总底板 */
.cart-summary {
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-light);
  padding: 0.5rem 0.75rem 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
  margin-top: auto;
  border-radius: 0 0 20px 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-primary);
  border-top: 1px dashed var(--border-light);
  padding-top: 0.6rem;
  margin-top: 0.3rem;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pay-method-btn {
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.pay-method-btn.selected, .pay-method-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* ==========================================================================
   2. 办卡充值模块 (Top-Up View)
   ========================================================================== */

.topup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.topup-tier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tier-card {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.8) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}

.tier-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.18) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.tier-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 0.3rem;
}

.tier-bonus {
  font-size: 0.85rem;
  color: var(--gold-primary);
  font-weight: 600;
}

/* 系统管理 Tab 导航与面板样式 */
.system-subtab-btn.active {
  background: var(--gold-gradient) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: var(--gold-primary) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.system-panel {
  display: none;
}

.system-panel.active {
  display: block;
}

/* ==========================================================================
   3. 生日月特惠弹窗 (Birthday Perk Modal)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100050 !important;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(14, 165, 233, 0.25);
  overflow: hidden;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 宽体双栏及快捷排班弹窗专属样式 (防超出屏幕) */
#edit-member-modal .modal-box,
#reschedule-modal .modal-box {
  width: 780px !important;
  max-width: 95vw !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#edit-member-modal .modal-body,
#reschedule-modal .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  -webkit-overflow-scrolling: touch;
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.birthday-modal-header {
  background: linear-gradient(135deg, #4c1d95 0%, #831843 100%);
  padding: 1.8rem;
  text-align: center;
  color: #fff;
  position: relative;
}

.birthday-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.modal-body {
  padding: 1.5rem;
}

/* ==========================================================================
   小票预览与打印样式 (Receipt Modal & Print CSS)
   ========================================================================== */

.receipt-box {
  width: 320px;
  background: #fff;
  color: #111;
  font-family: 'Courier New', Courier, monospace;
  padding: 1.2rem;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  font-size: 0.82rem;
  line-height: 1.4;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #333;
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
}

.receipt-title {
  font-size: 1.1rem;
  font-weight: bold;
}

.receipt-dashed-line {
  border-bottom: 1px dashed #333;
  margin: 0.6rem 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
}

@media print {
  body * {
    visibility: hidden;
  }
  
  /* Make the wrapper block so children can be visible */
  #print-zone-wrapper {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
  }
  
  #printable-receipt {
    display: none !important;
    visibility: hidden !important;
  }

  /* A5 Landscape Print Mode (Default and Only Format) */
  #printable-a5,
  #printable-a5 * {
    visibility: visible !important;
  }
  
  #printable-a5 {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 10mm 14mm !important;
    box-sizing: border-box !important;
    background: white;
  }

  @page {
    /* Set page size to A5 landscape */
    size: A5 landscape;
    margin: 8mm;
  }
}

/* ==========================================================================
   表格通用样式 (Data Tables)
   ========================================================================== */

.data-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg-surface-elevated);
  color: var(--gold-primary);
  padding: 0.85rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}

/* 全局 UI Toast 悬浮通知 */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999999 !important;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  min-width: 320px;
  max-width: 450px;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(14, 165, 233, 0.2);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.88rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast-message.toast-success {
  border-color: rgba(110, 231, 183, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(110, 231, 183, 0.2);
}

.toast-message.toast-warning {
  border-color: rgba(245, 158, 11, 0.6);
}

.toast-message.toast-danger {
  border-color: rgba(239, 68, 68, 0.6);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes fadeOutRight {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* WhatsApp 后台异步发送悬浮状态胶囊 */
.wa-bg-task-indicator {
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.wa-bg-task-indicator:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 20px rgba(37, 211, 102, 0.45);
}

/* WhatsApp 任务完成右上角弹出框 */
.wa-completed-box-container {
  box-sizing: border-box;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

.data-table tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* 预约日历时间块 (Appointments Grid) */
.appointment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.appointment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}

.appointment-card:hover {
  border-color: var(--gold-primary);
}

/* 👑 平板/手机端 高清浮动会员下拉菜单 (Custom Member Dropdown Menu) */
.custom-member-dropdown,
#issue-coupon-search-dropdown,
#coupon-modal-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10000;
  padding: 0.4rem;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.custom-dropdown-item,
.custom-member-dropdown-item,
#issue-coupon-search-dropdown > div,
#coupon-modal-search-dropdown > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.custom-dropdown-item:last-child,
.custom-member-dropdown-item:last-child {
  border-bottom: none;
}

.custom-dropdown-item:hover, .custom-dropdown-item:active,
.custom-member-dropdown-item:hover, .custom-member-dropdown-item:active {
  background: rgba(14, 165, 233, 0.18);
  border-color: var(--border-gold);
}

.custom-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.custom-dropdown-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.custom-dropdown-phone {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.custom-dropdown-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.custom-dropdown-balance {
  font-size: 0.88rem;
  font-weight: 700;
  color: #6ee7b7;
}

.custom-dropdown-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--gold-primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}


/* 🌟 物理级鼠标穿透保障：未激活的弹窗蒙层绝对不拦截任何点击事件 */
.modal-backdrop:not(.active) {
  display: none !important;
  pointer-events: none !important;
}
.modal-backdrop.active {
  display: flex !important;
  pointer-events: auto !important;
}

/* Collapsible Sidebar Styles */
.sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  white-space: nowrap;
}
.sidebar.collapsed {
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  padding: 1rem 0.5rem !important;
}
.sidebar.collapsed .brand-container > div:first-child,
.sidebar.collapsed .brand-text-wrapper,
.sidebar.collapsed .brand-logo {
  display: none !important;
}
.sidebar.collapsed .brand-container {
  justify-content: center !important;
  padding-bottom: 1rem !important;
  margin-bottom: 1rem !important;
}
.sidebar.collapsed .sidebar-toggle {
  margin: 0 auto !important;
  font-size: 1.35rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.sidebar.collapsed .nav-menu {
  padding: 0 !important;
  margin: 0 !important;
  align-items: center !important;
  width: 100% !important;
}
.sidebar.collapsed .nav-menu > li {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}
.sidebar.collapsed .nav-item {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  margin: 6px auto !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  font-size: 0 !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
}
.sidebar.collapsed .nav-item.active {
  background: var(--gold-primary) !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
}
.sidebar.collapsed .nav-item.active i {
  color: #ffffff !important;
}
.sidebar.collapsed .nav-item i {
  font-size: 1.25rem !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item .plan-lock-badge,
.sidebar.collapsed .nav-item #daas-unread-badge,
.sidebar.collapsed .nav-item .fa-chevron-down,
.sidebar.collapsed .nav-item .nav-dropdown-arrow {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  pointer-events: none !important;
}
.sidebar.collapsed #reports-menu,
.sidebar.collapsed #marketing-menu,
.sidebar.collapsed #sys-mgt-menu {
  display: none !important;
}

/* Strictly hide deduct item in all sidebar states */
.nav-item[data-view="deduct"],
.sidebar .nav-item[data-view="deduct"],
.sidebar.collapsed .nav-item[data-view="deduct"],
.sidebar.collapsed li[data-view="deduct"] {
  display: none !important;
  visibility: hidden !important;
}
.sidebar.collapsed .sidebar-footer {
  display: none !important;
}

/* Nav item styling for the Beige theme */
.nav-item {
  color: #64748b;
  transition: all 0.2s ease;
}
.nav-item:hover, .nav-item.active {
  background: var(--bg-surface) !important;
  color: var(--gold-primary) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.nav-item:hover i, .nav-item.active i {
  color: var(--gold-primary) !important;
}
.sidebar.collapsed .nav-item.active i {
  color: #ffffff !important;
}

/* 展开状态下的下拉菜单行 */
.nav-item.nav-dropdown-toggle {
  display: flex !important;
  align-items: center !important;
}
.nav-item.nav-dropdown-toggle .nav-dropdown-arrow {
  margin-left: auto !important;
  font-size: 0.75rem !important;
  flex-shrink: 0 !important;
  width: auto !important;
}



/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Engine (Redesigned)
   ========================================================================== */

/* Hide mobile specific elements on Desktop */
.mobile-sidebar-toggle-btn {
  display: none;
}
.mobile-drawer-overlay {
  display: none;
}
.mobile-bottom-nav {
  display: none;
}
.mobile-cart-fab, .mobile-cart-close {
  display: none;
}

/* Explicitly hide all mobile-specific elements on Desktop (>= 769px) */
.mobile-sidebar-toggle-btn,
.mobile-drawer-overlay,
.mobile-bottom-nav,
.mob-nav-item,
.mobile-cart-bar,
.mobile-cart-overlay,
.mobile-cart-close-btn,
.mobile-cart-fab,
.mobile-cart-close {
  display: none !important;
}

/* Tablet (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 76px !important;
    min-width: 76px !important;
  }
  .sidebar .brand-text-wrapper, .sidebar .brand-logo, .sidebar .sidebar-footer {
    display: none !important;
  }
  .sidebar .brand-container {
    justify-content: center !important;
  }
  .sidebar .sidebar-toggle {
    margin: 0 auto;
    font-size: 1.35rem;
  }
  .sidebar .nav-item {
    justify-content: center !important;
    font-size: 0 !important;
    padding: 0.8rem !important;
  }
  .sidebar .nav-item i {
    font-size: 1.2rem !important;
    margin-right: 0 !important;
  }
  .sidebar .nav-item.active {
    background: var(--gold-primary) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
  }
  .cashier-container {
    grid-template-columns: 1fr 1fr;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Mobile Devices (Under 768px) */
@media screen and (max-width: 768px) {
  html, body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
  }

  #app {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    display: block !important; /* Stack cleanly on mobile */
    position: relative !important;
  }

  /* Sidebar Drawer - Absolutely Off-Screen on Mobile */
  .sidebar,
  .sidebar.collapsed,
  aside.sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 270px !important;
    min-width: 270px !important;
    max-width: 80vw !important;
    z-index: 100005 !important;
    background: var(--bg-surface) !important;
    box-shadow: 0 0 50px rgba(0,0,0,0.5) !important;
    transform: translateX(-120%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 1.2rem 1rem !important;
  }
  .sidebar.mobile-open,
  .sidebar.collapsed.mobile-open,
  aside.sidebar.mobile-open {
    transform: translateX(0) !important;
  }
  .sidebar .brand-text-wrapper,
  .sidebar .brand-logo,
  .sidebar .sidebar-footer {
    display: flex !important;
  }
  .sidebar .nav-item span {
    font-size: 0.9rem !important;
    display: inline !important;
  }
  .sidebar .nav-item {
    width: 100% !important;
    height: auto !important;
    justify-content: flex-start !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    margin: 4px 0 !important;
  }

  .mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 100001;
    opacity: 0;
    transition: opacity 0.28s ease;
  }
  .mobile-drawer-overlay.active {
    display: block !important;
    opacity: 1 !important;
  }
  
  .mobile-sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-light);
    color: var(--gold-primary);
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  /* Top Header on Mobile - Clean 1-Line Flex */
  .top-header {
    height: 52px !important;
    margin: 0 0 0.5rem 0 !important;
    border-radius: 0 !important;
    padding: 0 0.6rem !important;
    gap: 0.4rem !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-light) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
  }
  .header-title-group {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    flex: 1 !important;
    margin: 0 !important;
  }
  .header-title-group h2 {
    font-size: 1rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    color: var(--gold-primary) !important;
  }
  .header-title-group p,
  .system-clock {
    display: none !important;
  }

  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
  }
  .header-current-user {
    margin-right: 0 !important;
    gap: 0.2rem !important;
    font-size: 0.75rem !important;
  }
  .header-username-text {
    display: none !important; /* Hide long user text on mobile */
  }
  .header-logout-btn {
    padding: 0.25rem 0.45rem !important;
    font-size: 0.72rem !important;
    margin-left: 0.1rem !important;
    border-radius: 6px !important;
  }
  .btn-header {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    height: 36px !important;
    min-width: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation !important;
  }
  .btn-header[title="新增会员"],
  .btn-header[onclick*="addNewMemberModal"] {
    min-width: 38px !important;
    height: 38px !important;
    background: rgba(212, 175, 55, 0.16) !important;
    border: 1px solid rgba(212, 175, 55, 0.5) !important;
    color: var(--gold-primary) !important;
    border-radius: 9px !important;
  }
  .btn-header-text {
    display: none !important; /* Icon-only on mobile */
  }

  /* Main Workspace */
  .main-content {
    border-radius: 0 !important;
    margin: 0 !important;
    height: calc(100vh - 52px) !important;
    box-shadow: none !important;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 24px)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    display: block !important;
  }
  .view-container {
    padding: 0.4rem 0.5rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .glass-card {
    padding: 0.8rem !important;
    margin-bottom: 0.7rem !important;
    border-radius: 12px !important;
  }

  /* Universal Grid Collapse to 1 Column */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns:1.2fr 1fr"],
  [style*="grid-template-columns:1fr 1.2fr 1.5fr"],
  [style*="grid-template-columns: 1fr 1.2fr 1.5fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  
  
  
  
  /* ⏳ Waiting List & Setup Mobile Optimization */
  #booking-subview-waiting > div[style*="grid-template-columns:300px 1fr"],
  #booking-subview-waiting > div[style*="grid-template-columns: 300px 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }
  #booking-subview-waiting > div > div {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.85rem !important;
  }
  #booking-subview-waiting .btn-gold.btn-full {
    height: 46px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
  }
  #booking-subview-waiting table {
    min-width: 520px !important;
  }

  /* ⚙️ Roster & Resource Maintenance Mobile Optimization */
  #booking-subview-setup > div[style*="grid-template-columns: 1.2fr 1fr"],
  #booking-subview-setup > div[style*="grid-template-columns:1.2fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.2rem !important;
    width: 100% !important;
  }
  #booking-subview-setup > div > div {
    width: 100% !important;
    box-sizing: border-box !important;
    border-right: none !important;
    padding-right: 0 !important;
  }
  #booking-subview-setup [style*="grid-template-columns:1fr 1fr"],
  #booking-subview-setup [style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  #booking-subview-setup table {
    min-width: 480px !important;
  }
  #booking-subview-setup .btn-gold.btn-xs {
    width: 100% !important;
    height: 42px !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* 📱 Appointment Card Mobile Overhaul */
  .appointment-card-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    align-items: stretch !important;
    padding: 0.85rem !important;
    border-radius: 14px !important;
  }
  .apt-time-col {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px dashed rgba(255,255,255,0.12) !important;
    padding-bottom: 0.45rem !important;
    margin-bottom: 0.1rem !important;
    width: 100% !important;
  }
  .apt-info-col {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
  }
  .apt-info-col > div {
    white-space: normal !important;
    word-break: break-word !important;
  }
  .apt-info-col div[style*="width:fit-content"] {
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    padding: 6px 10px !important;
    display: flex !important;
  }
  .apt-actions-col {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.45rem !important;
    max-width: 100% !important;
    width: 100% !important;
    justify-content: stretch !important;
    border-top: 1px dashed rgba(255,255,255,0.12) !important;
    padding-top: 0.55rem !important;
    margin-top: 0.2rem !important;
  }
  .apt-actions-col .btn {
    width: 100% !important;
    padding: 0.45rem 0.2rem !important;
    font-size: 0.78rem !important;
    text-align: center !important;
    justify-content: center !important;
    display: inline-flex !important;
    align-items: center !important;
    border-radius: 8px !important;
  }

  /* 📅 Appointment & Booking Scheduling Mobile Optimization */
  #view-appointments > div:first-child {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.45rem !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.8rem !important;
    border-bottom: 1px solid var(--border-light) !important;
  }
  #view-appointments > div:first-child .btn-sm {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
    border-radius: 99px !important;
  }
  
  /* Booking Wizard Collapse to 1 Column & 1~7 Sequential Order */
  #wizard-flow-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }
  #wizard-flow-layout > div {
    display: contents !important;
  }
  .wizard-step-card {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 1rem 0.85rem !important;
    margin-bottom: 0 !important;
    border-radius: 12px !important;
  }
  .wizard-step-1 { order: 1 !important; }
  .wizard-step-2 { order: 2 !important; }
  .wizard-step-3 { order: 3 !important; }
  .wizard-step-4 { order: 4 !important; }
  .wizard-step-5 { order: 5 !important; }
  .wizard-step-6 { order: 6 !important; }
  .wizard-step-7 { order: 7 !important; }

  #booking-subview-wizard > .card {
    padding: 0.9rem 0.75rem !important;
    border-radius: 12px !important;
  }
  #booking-subview-wizard > .card > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
  }
  #booking-member-search,
  #booking-persons-count-select,
  #booking-second-person-input,
  #booking-duration-input,
  #booking-date-select,
  #booking-room-select,
  #booking-resource-select {
    height: 44px !important;
    font-size: 0.92rem !important;
  }
  #booking-room-container {
    padding: 0.75rem !important;
    margin-bottom: 0.8rem !important;
  }
  #booking-room-container > div:first-child {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }
  #booking-room-auto-badge {
    font-size: 0.68rem !important;
    padding: 2px 6px !important;
    white-space: nowrap !important;
  }
  #booking-slots-container {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.45rem !important;
    max-height: 230px !important;
    padding: 0.4rem !important;
  }
  #booking-slots-container button,
  #booking-slots-container .time-slot-btn {
    padding: 0.5rem 0.2rem !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
    text-align: center !important;
    min-height: 44px !important;
  }
  #btn-submit-booking {
    height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
  }

  /* Booking Board Filters on Mobile */
  #booking-subview-board .card-title {
    font-size: 1rem !important;
  }
  #booking-subview-board [style*="justify-content:space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
  #booking-subview-board [style*="justify-content:space-between"] > div {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }
  #booking-filter-date, #booking-filter-status {
    width: 100% !important;
    flex: 1 !important;
    min-height: 38px !important;
  }
  #booking-subview-board [style*="width:190px"] {
    width: 100% !important;
  }
  #booking-search-phone {
    width: 100% !important;
    min-height: 38px !important;
  }
  
  /* Appointment Cards in Board on Mobile */
  #appointments-grid > div {
    padding: 0.85rem !important;
    border-radius: 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
  }
  #appointments-grid .btn {
    padding: 0.45rem 0.5rem !important;
    font-size: 0.8rem !important;
  }

  /* Top-up View Mobile Optimization */
  .topup-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .topup-grid > div {
    width: 100% !important;
  }
  .topup-quick-chips {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.4rem !important;
  }
  .quick-chip-btn {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.2rem !important;
  }
  #topup-amount-input {
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    text-align: center !important;
    color: var(--gold-primary) !important;
    height: 46px !important;
  }
  #topup-pay-method-select, #topup-operator-select {
    height: 44px !important;
    font-size: 0.9rem !important;
  }
  .topup-grid .btn-gold.btn-full {
    height: 50px !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    margin-top: 1.2rem !important;
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.35) !important;
  }

  /* Cashier Layout on Mobile */
  .cashier-grid, .cashier-container {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
  }
  .cashier-left {
    width: 100% !important;
    padding: 0 4px calc(95px + env(safe-area-inset-bottom, 20px)) 4px !important;
    box-sizing: border-box !important;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    margin-top: 0.4rem !important;
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 10px)) !important;
    box-sizing: border-box !important;
  }
  .product-card {
    padding: 0.7rem 0.75rem !important;
    border-radius: 14px !important;
    min-height: 125px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-light) !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
    overflow: hidden !important;
  }
  .product-card-body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
    min-height: 100% !important;
    width: 100% !important;
    flex: 1 !important;
  }
  .product-card-top-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    margin-bottom: 0.25rem !important;
    width: 100% !important;
    min-height: 22px !important;
  }
  .product-category-pill {
    font-size: 0.68rem !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    max-width: 95px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .product-title, .product-card .card-title, .product-card .product-title {
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    line-height: 1.3 !important;
    margin: 0.2rem 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 2.2em !important;
  }
  .product-desc {
    display: none !important;
  }
  .product-price-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-top: auto !important;
    padding-top: 4px !important;
  }
  .product-price, .product-card .card-price, .product-card .product-price {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: var(--gold-primary) !important;
    white-space: nowrap !important;
    margin: 0 !important;
  }
  .product-price-row .btn {
    padding: 3px 8px !important;
    font-size: 0.75rem !important;
    border-radius: 99px !important;
    flex-shrink: 0 !important;
  }

  /* Category pills */
  .category-pills, .categories-container, .category-tabs {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.4rem !important;
    padding: 2px 0 6px 0 !important;
    margin-bottom: 0.5rem !important;
    white-space: nowrap !important;
  }
  .pill-item, .category-pill, .cat-btn {
    padding: 0.35rem 0.85rem !important;
    font-size: 0.8rem !important;
    border-radius: 99px !important;
    flex-shrink: 0 !important;
  }

  /* 📱 Mobile Floating Cart Bar */
  .mobile-cart-bar {
    display: flex !important;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 52px;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.6);
    border-radius: 99px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
    z-index: 99990;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .mobile-cart-bar:active {
    transform: scale(0.98);
  }
  .cart-badge-icon {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
  }
  .cart-badge-num {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 99px;
    padding: 1px 5px;
    line-height: 1.2;
  }

  /* 📱 Mobile Cart Sliding Drawer */
  .cashier-right {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 88vh !important;
    max-height: 88vh !important;
    background: var(--bg-surface) !important;
    z-index: 100010 !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.55) !important;
    transform: translateY(125%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: transform 0.32s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.25s ease, visibility 0.32s !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1rem !important;
    border: 1px solid var(--border-light) !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
  }
  .cashier-right.mobile-open {
    transform: translateY(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
  }
  .mobile-cart-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 100009;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s;
  }
  .mobile-cart-overlay.active {
    display: block !important;
    opacity: 1 !important;
  }
  
  .mobile-cart-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
  }

  /* Data Table Horizontal Scroll */
  .data-table-container, .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-light) !important;
    margin-bottom: 0.8rem !important;
  }
  .data-table {
    min-width: 550px !important;
    font-size: 0.8rem !important;
  }
  .data-table th, .data-table td {
    padding: 0.6rem 0.5rem !important;
    white-space: nowrap !important;
  }

  /* Form Elements Touch Optimize */
  .form-control, select.form-control, input.form-control {
    font-size: 16px !important;
    min-height: 38px !important;
    border-radius: 8px !important;
  }
  
  /* Modals on Mobile */
  .modal-backdrop {
    display: none;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1rem 0.5rem 4rem 0.5rem !important;
  }
  .modal-backdrop.active {
    display: flex !important;
    pointer-events: auto !important;
  }
  .modal-backdrop .glass-card,
  .modal-backdrop > div:not(.glass-card),
  .modal-backdrop .modal-box {
    width: 95% !important;
    max-width: 95vw !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    border-radius: 16px !important;
    margin: 0.8rem auto 3.5rem auto !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
  }
  .modal-backdrop .modal-box .modal-body {
    padding: 1.2rem 1rem 1.8rem 1rem !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .modal-backdrop button {
    touch-action: manipulation !important;
  }
}


/* Submenu and Sidebar Nav Item Width Polish */
.sidebar .nav-item {
  font-size: 0.88rem !important;
  white-space: nowrap !important;
  line-height: 1.25 !important;
  box-sizing: border-box !important;
}

#reports-menu,
#marketing-menu,
#sys-mgt-menu {
  padding-left: 0.5rem !important;
  margin: 0 !important;
}

#reports-menu .nav-item,
#marketing-menu .nav-item,
#sys-mgt-menu .nav-item {
  padding: 0.42rem 0.55rem !important;
  margin: 2px 2px !important;
  font-size: 0.83rem !important;
  gap: 0.45rem !important;
  min-height: 34px !important;
  white-space: nowrap !important;
}

#reports-menu .nav-item i,
#marketing-menu .nav-item i,
#sys-mgt-menu .nav-item i {
  font-size: 0.95rem !important;
  width: 18px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
}

/* 🔒 Plan Access Badges */
.plan-lock-badge {
  margin-left: auto !important;
  font-size: 0.65rem !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}
.plan-lock-badge.badge-premium {
  background: rgba(234, 179, 8, 0.15) !important;
  color: #facc15 !important;
  border: 1px solid rgba(234, 179, 8, 0.35) !important;
}
.plan-lock-badge.badge-upgrade {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.28) !important;
}

.sidebar.collapsed .plan-lock-badge,
.sidebar.collapsed .plan-lock-badge * {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}





/* Spinner & Success Modal Animations */
@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.fa-spin {
  animation: fa-spin 0.85s infinite linear !important;
  display: inline-block;
}

/* 🏷️ Quick Selection Chips / Tags */
.btn-tag {
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-light, rgba(255, 255, 255, 0.12));
  color: var(--text-muted, #94a3b8);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
}
.btn-tag:hover {
  border-color: var(--gold-primary, #f59e0b);
  color: var(--gold-primary, #f59e0b);
}
.btn-tag.active {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: var(--gold-primary, #f59e0b) !important;
  color: var(--gold-primary, #f59e0b) !important;
  font-weight: 700 !important;
}



/* 🧾 Receipt & Invoice Modal Fixed Layout (Always visible header/footer, scrollable body) */
#receipt-modal.modal-backdrop {
  align-items: center !important;
  justify-content: center !important;
  overflow-y: auto !important;
  padding: 1.5rem 1rem !important;
  box-sizing: border-box !important;
}

@media screen and (max-height: 850px) {
  #receipt-modal.modal-backdrop {
    align-items: flex-start !important;
  }
}

#receipt-modal .modal-box {
  width: 720px !important;
  max-width: 96% !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid var(--border-gold, #d4af37) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6) !important;
  margin: auto !important;
}

#receipt-modal .modal-box > div:first-child {
  flex-shrink: 0 !important;
  z-index: 10 !important;
}

#receipt-modal .modal-box .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 1.2rem !important;
  background: #f1f5f9 !important;
}

#receipt-modal .modal-box .receipt-modal-footer {
  flex-shrink: 0 !important;
  z-index: 10 !important;
}

/* ⚡ Skeleton Card Loader for Instant POS Feel */
.skeleton-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-md, 8px);
  padding: 1rem;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer {
  background: linear-gradient(90deg, rgba(150, 150, 150, 0.08) 25%, rgba(150, 150, 150, 0.18) 50%, rgba(150, 150, 150, 0.08) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-title {
  height: 1.1rem;
  width: 75%;
  margin-bottom: 0.5rem;
}

.skeleton-desc {
  height: 0.8rem;
  width: 45%;
  margin-bottom: 1rem;
}

.skeleton-price {
  height: 1.2rem;
  width: 50%;
}

/* ==========================================================================
   💬 WhatsApp 前台一体化即时客服接待抽屉 (Live Concierge Drawer & FAB)
   👑 SaaS Premium 旗舰版专属
   ========================================================================== */

/* 1. 右下角常驻微质感悬浮接待球 (FAB) - 支持自由拖拽移动防遮挡 */
.wa-concierge-fab {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 100020 !important;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab !important;
  pointer-events: auto !important;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.28s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.wa-concierge-fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.wa-concierge-fab:active {
  cursor: grabbing !important;
  transform: scale(0.95);
}

.wa-concierge-fab.is-dragging {
  cursor: grabbing !important;
  transition: none !important;
  transform: scale(1.1) !important;
  box-shadow: 0 16px 36px rgba(37, 211, 102, 0.65), 0 6px 16px rgba(0, 0, 0, 0.28) !important;
}

.wa-fab-icon-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.wa-fab-icon-wrap i {
  color: #ffffff;
  font-size: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.wa-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: waPulseBadge 2s infinite;
  pointer-events: none;
}

@keyframes waPulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.wa-fab-tooltip {
  position: absolute;
  right: 68px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wa-concierge-fab:hover .wa-fab-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.wa-concierge-fab.is-dragging .wa-fab-tooltip {
  display: none !important;
  opacity: 0 !important;
}

.wa-concierge-fab.tooltip-right .wa-fab-tooltip {
  right: auto;
  left: 68px;
  transform: translateX(-8px);
}

.wa-concierge-fab.tooltip-right:hover .wa-fab-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* 2. 抽屉全屏容器与遮罩 */
.wa-drawer-wrapper {
  position: fixed;
  inset: 0;
  z-index: 100030;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.3s ease;
}

.wa-drawer-wrapper.open,
.wa-drawer-wrapper.active {
  pointer-events: auto !important;
  visibility: visible !important;
}

.wa-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wa-drawer-wrapper.open .wa-drawer-backdrop,
.wa-drawer-wrapper.active .wa-drawer-backdrop {
  opacity: 1 !important;
}

/* 3. 右侧全高滑出式工作台面板 (Slide-out Drawer Panel) */
.wa-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1040px;
  max-width: 95vw;
  height: 100vh;
  background: var(--bg-surface, #ffffff);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.wa-drawer-wrapper.open .wa-drawer-panel,
.wa-drawer-wrapper.active .wa-drawer-panel {
  transform: translateX(0) !important;
}

/* 4. 抽屉顶部 Header */
.wa-drawer-header {
  height: 62px;
  background: var(--bg-surface-elevated, #ffffff);
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wa-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.wa-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.wa-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}

.badge-premium-pill {
  font-size: 0.68rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.02rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.wa-header-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.wa-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.wa-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.wa-status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wa-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: transparent;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.wa-btn-icon:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
  color: var(--text-main, #1e293b);
}

/* 5. 抽屉工作台主体 (三栏并排) */
.wa-drawer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* 栏 1：左侧客户会话列表 (290px) */
.wa-col-chats {
  width: 290px;
  border-right: 1px solid var(--border-light, #e2e8f0);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-elevated, #ffffff);
  flex-shrink: 0;
}

.wa-search-bar {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  position: relative;
  display: flex;
  align-items: center;
}

.wa-search-bar > i,
.wa-search-bar .wa-search-input-wrap > i {
  position: absolute;
  left: 1.25rem;
  color: var(--text-muted, #94a3b8);
  font-size: 0.85rem;
  pointer-events: none;
}

.wa-search-bar button i,
.wa-search-bar .wa-btn-icon i {
  position: static !important;
  left: auto !important;
  top: auto !important;
  color: inherit !important;
  font-size: 0.9rem !important;
  pointer-events: none;
}

.wa-search-bar input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-input, #f8fafc);
  color: var(--text-main, #1e293b);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.wa-search-bar input:focus {
  border-color: var(--gold-primary, #8b5cf6);
  background: #ffffff;
}

.wa-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 0;
}

.wa-chat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  transition: background-color 0.15s ease;
}

.wa-chat-item:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.03));
}

.wa-chat-item.active {
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid var(--gold-primary, #8b5cf6);
}

.wa-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.wa-chat-item.active .wa-chat-avatar {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
}

.wa-chat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-chat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-chat-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.wa-chat-time {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.wa-chat-row-mid {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-tier-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  line-height: 1.2;
}

.wa-tier-tag.vip {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.wa-tier-tag.guest {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

.wa-chat-phone {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-chat-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.wa-chat-snippet {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.wa-chat-item.unread .wa-chat-snippet {
  font-weight: 700;
  color: var(--text-main, #1e293b);
}

.wa-unread-dot {
  background: #25D366;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 栏 2：中栏即时对话流与输入区 (flex: 1) */
.wa-col-stream {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #efeae2; /* 经典 WhatsApp 聊天背景质感 */
  position: relative;
}

.theme-dark .wa-col-stream {
  background: #0b141a;
}

.wa-stream-header {
  height: 58px;
  background: var(--bg-surface-elevated, #ffffff);
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 2;
}

.wa-stream-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wa-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.wa-stream-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  line-height: 1.2;
}

.wa-stream-phone {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
}

/* 对话气泡容器 */
.wa-bubbles-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wa-no-chat-selected {
  margin: auto;
  text-align: center;
  color: var(--text-muted, #64748b);
  max-width: 360px;
  padding: 2rem;
}

.wa-placeholder-icon {
  font-size: 3.5rem;
  color: #25D366;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.wa-no-chat-selected h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main, #1e293b);
}

.wa-no-chat-selected p {
  font-size: 0.85rem;
  line-height: 1.5;
}

.wa-bubble-row {
  display: flex;
  width: 100%;
}

.wa-bubble-row.outbound {
  justify-content: flex-end;
}

.wa-bubble-row.inbound {
  justify-content: flex-start;
}

.wa-bubble {
  max-width: 72%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  position: relative;
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.88rem;
}

.wa-bubble-row.inbound .wa-bubble {
  background: #ffffff;
  color: #111827;
  border-top-left-radius: 2px;
}

.wa-bubble-row.outbound .wa-bubble {
  background: #d9fdd3; /* 经典 WhatsApp 绿色发信气泡 */
  color: #111827;
  border-top-right-radius: 2px;
}

.theme-dark .wa-bubble-row.inbound .wa-bubble {
  background: #202c33;
  color: #e9edef;
}

.theme-dark .wa-bubble-row.outbound .wa-bubble {
  background: #005c4b;
  color: #e9edef;
}

.wa-bubble-text {
  white-space: pre-wrap;
}

.wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: #667781;
}

.theme-dark .wa-bubble-meta {
  color: #8696a0;
}

.wa-stream-input-bar {
  padding: 0.75rem 1rem;
  background: var(--bg-surface-elevated, #ffffff);
  border-top: 1px solid var(--border-light, #e2e8f0);
  flex-shrink: 0;
  z-index: 2;
}

.wa-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.wa-input-row textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 0.55rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-input, #f8fafc);
  color: var(--text-main, #1e293b);
  font-size: 0.88rem;
  resize: none;
  outline: none;
  line-height: 1.4;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.wa-input-row textarea:focus {
  border-color: #25D366;
  background: #ffffff;
}

.wa-btn-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.wa-btn-send:hover {
  background: #1eb954;
  transform: scale(1.05);
}

/* 顶部单聊顶栏快捷预约金键 */
.wa-btn-header-booking {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #d4af37, #f59e0b) !important;
  color: #1a1a1a !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.35) !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}

.wa-btn-header-booking:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.45) !important;
}

.wa-btn-header-booking:active {
  transform: scale(0.96);
}

/* 底部快捷操作胶囊条 (Quick Actions Bar) */
.wa-quick-actions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 2px 6px 2px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.wa-quick-actions-bar::-webkit-scrollbar {
  display: none;
}

.wa-quick-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-main, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1.4;
  user-select: none;
}

.wa-quick-action-pill:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-main, #0f172a);
}

.wa-quick-action-pill:active {
  transform: scale(0.96);
}

.wa-quick-action-pill.wa-pill-gold {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(245, 158, 11, 0.22));
  border-color: rgba(212, 175, 55, 0.45);
  color: #b45309;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(212, 175, 55, 0.2);
}

.wa-quick-action-pill.wa-pill-gold:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.26), rgba(245, 158, 11, 0.32));
}

.theme-dark .wa-quick-action-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.theme-dark .wa-quick-action-pill.wa-pill-gold {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.4);
  color: #fde047;
}

/* 栏 3：右栏会员资料穿透与快捷预约 (300px) */
.wa-col-member-panel {
  width: 300px;
  border-left: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-surface-elevated, #ffffff);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.1rem;
  flex-shrink: 0;
}

.wa-member-placeholder {
  margin: auto;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  padding: 1.5rem;
}

.wa-member-placeholder i {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.wa-member-placeholder p {
  font-size: 0.82rem;
  line-height: 1.5;
}

.wa-member-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.wa-mc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.wa-mc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.wa-mc-avatar.guest {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.wa-mc-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  line-height: 1.2;
}

.wa-mc-id {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
}

.wa-mc-header .wa-tier-tag {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 3px 8px;
}

/* 资产看板 */
.wa-mc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.wa-stat-box {
  background: var(--bg-card, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  padding: 0.65rem 0.5rem;
  text-align: center;
}

.wa-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 3px;
}

.wa-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
}

.wa-stat-val.gold {
  color: #d97706;
}

.wa-stat-val.purple {
  color: #8b5cf6;
}

/* 详细信息列表 */
.wa-mc-details {
  background: var(--bg-card, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wa-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.wa-detail-row .label {
  color: var(--text-muted, #64748b);
}

.wa-detail-row .val {
  font-weight: 600;
  color: var(--text-main, #1e293b);
}

/* 待履约排期 */
.wa-mc-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-mc-apts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wa-apt-mini-card {
  background: var(--bg-card, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wa-am-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-am-mid {
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-am-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 0.74rem;
}

.wa-guest-tip {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.78rem;
  color: #2563eb;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.wa-mc-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
}

/* 6. 内嵌式快速预约微弹窗 (Micro Modal) */
.wa-quick-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  background: rgba(15, 23, 42, 0.7) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wa-quick-modal-box {
  background: var(--bg-surface-elevated, #ffffff);
  border-radius: 14px;
  width: 440px;
  max-width: 95%;
  border: 1px solid var(--border-light, #e2e8f0);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: waScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes waScaleUp {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.wa-quick-modal-header {
  padding: 0.85rem 1.1rem;
  background: var(--bg-surface, #ffffff);
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-quick-modal-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wa-quick-modal-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 70vh;
  overflow-y: auto;
}

.wa-quick-modal-footer {
  padding: 0.85rem 1.1rem;
  background: var(--bg-surface, #f8fafc);
  border-top: 1px solid var(--border-light, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.wa-empty-hint {
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 0.82rem;
  padding: 2rem 1rem;
}

/* ==========================================================================
   📱 移动端与平板响应式界面优化 (Mobile & Tablet Experience)
   ========================================================================== */

/* 默认桌面端隐藏移动专属元素 */
.wa-btn-stream-back {
  display: none;
}

.wa-mobile-close-btn {
  display: none;
}

/* 平板设备 (769px ~ 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .wa-drawer-panel {
    width: 90vw !important;
    max-width: 90vw !important;
  }
  .wa-col-chats {
    width: 280px !important;
  }
  .wa-col-member-panel {
    display: none !important; /* 平板折叠会员侧栏，专注聊天与接待 */
  }
}

/* 手机竖屏与小屏设备 (<= 768px) */
@media (max-width: 768px) {
  .wa-drawer-wrapper {
    z-index: 100050 !important;
  }

  .wa-drawer-backdrop {
    display: none !important; /* 手机全屏覆盖，免去背景多余遮罩 */
  }

  .wa-drawer-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* 抽屉大顶栏 */
  .wa-drawer-header {
    height: auto !important;
    min-height: 52px !important;
    padding: 8px 12px !important;
    padding-top: max(8px, env(safe-area-inset-top)) !important;
    border-bottom: 1px solid var(--border-light, #e2e8f0) !important;
  }

  /* 进入单聊时隐藏外层总顶栏，避免与单聊联系人顶栏重叠双层 */
  .wa-drawer-panel.in-chat .wa-drawer-header {
    display: none !important;
  }

  .wa-header-left {
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }

  .wa-header-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 1.15rem !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  .wa-header-title {
    font-size: 0.92rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .wa-header-title .badge-premium-pill {
    display: none !important; /* 手机端隐藏超长徽章，避免标题换行折叠 */
  }

  .wa-header-subtitle {
    font-size: 0.72rem !important;
    margin-top: 1px !important;
  }

  .wa-header-actions {
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .wa-btn-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.88rem !important;
  }

  /* 主体工作区单栏切换 */
  .wa-drawer-body {
    flex: 1 !important;
    min-height: 0 !important;
    width: 100% !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* 视图 1：客户会话列表 (未进入单聊时 100% 铺满手机屏) */
  .wa-col-chats {
    width: 100% !important;
    max-width: 100% !important;
    border-right: none !important;
    flex: 1 !important;
    display: flex !important;
    min-height: 0 !important;
  }

  .wa-drawer-panel.in-chat .wa-col-chats {
    display: none !important;
  }

  .wa-search-bar {
    padding: 8px 10px !important;
  }

  .wa-chat-item {
    padding: 10px 12px !important;
    gap: 10px !important;
  }

  .wa-chat-item:active {
    background: rgba(37, 211, 102, 0.08) !important;
  }

  .wa-chat-avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.15rem !important;
  }

  .wa-chat-name {
    font-size: 0.92rem !important;
  }

  .wa-chat-time {
    font-size: 0.72rem !important;
  }

  .wa-chat-phone {
    font-size: 0.78rem !important;
  }

  .wa-chat-snippet {
    font-size: 0.78rem !important;
  }

  /* 视图 2：对话消息流 (进入单聊时 100% 铺满手机屏) */
  .wa-col-stream {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
    min-height: 0 !important;
    display: none !important;
  }

  .wa-drawer-panel.in-chat .wa-col-stream {
    display: flex !important;
  }

  .wa-col-member-panel {
    display: none !important;
  }

  /* 单聊顶部联系人状态栏 (移动端返回键与全屏适配) */
  .wa-stream-header {
    height: auto !important;
    min-height: 52px !important;
    padding: 6px 10px !important;
    padding-top: max(6px, env(safe-area-inset-top)) !important;
    background: var(--bg-surface-elevated, #ffffff) !important;
    border-bottom: 1px solid var(--border-light, #e2e8f0) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    z-index: 10 !important;
  }

  .wa-btn-stream-back {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-main, #1e293b) !important;
    font-size: 1.15rem !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin-right: 2px !important;
    transition: background 0.15s ease !important;
  }

  .wa-btn-stream-back:active {
    background: var(--bg-hover, rgba(0, 0, 0, 0.08)) !important;
  }

  .wa-mobile-close-btn {
    display: flex !important;
  }

  .wa-stream-user-info {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }

  .wa-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
  }

  .wa-stream-name {
    font-size: 0.9rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 140px !important;
  }

  .wa-stream-phone {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .wa-stream-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .wa-btn-header-booking {
    padding: 3px 8px !important;
    font-size: 0.74rem !important;
    height: 32px !important;
  }

  #wa-btn-view-member {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    height: 32px !important;
  }

  /* 聊天气泡 */
  .wa-bubbles-container {
    padding: 0.75rem 0.6rem !important;
    gap: 0.5rem !important;
  }

  .wa-bubble {
    max-width: 86% !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 10px !important;
  }

  /* 底部发送输入栏适配手机键盘与底部安全区 */
  .wa-stream-input-bar {
    padding: 6px 8px !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    border-top: 1px solid var(--border-light, #e2e8f0) !important;
  }

  .wa-input-row {
    gap: 4px !important;
  }

  .wa-input-row textarea {
    font-size: 0.88rem !important;
    padding: 6px 10px !important;
    min-height: 38px !important;
    border-radius: 19px !important;
  }

  .wa-btn-send {
    width: 38px !important;
    height: 38px !important;
    font-size: 0.9rem !important;
    flex-shrink: 0 !important;
  }

  #wa-btn-attach {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.05rem !important;
  }

  /* 弹窗手机端尺寸适配 */
  .wa-quick-modal-box {
    width: 94vw !important;
    max-width: 94vw !important;
    margin: 8px auto !important;
    border-radius: 12px !important;
  }

  .wa-quick-modal-body {
    padding: 0.85rem !important;
    max-height: 60vh !important;
  }
}

/* ==========================================================================
   🔒 会员安全 PIN 码独立虚拟数字键盘 (Member Security PIN Keypad)
   ========================================================================== */
.pin-dots-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0.8rem 0 0.5rem 0;
}

.pin-dot-box {
  width: 44px;
  height: 50px;
  border: 1.5px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-surface-elevated, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold-primary, #8b5cf6);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.pin-dot-box.active {
  border-color: var(--gold-primary, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
  transform: translateY(-1px);
}

.pin-dot-box.filled {
  border-color: var(--gold-primary, #8b5cf6);
  background: rgba(139, 92, 246, 0.08);
}

.pin-dot-box.filled::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold-primary, #8b5cf6);
  display: block;
  animation: pinPopIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.35);
}

@keyframes pinPopIn {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

.pin-shake {
  animation: pinShake 0.4s ease-in-out;
}

/* 3x4 触控数字键盘 */
.pin-numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 1.1rem 0 1rem 0;
  user-select: none;
  -webkit-user-select: none;
}

.pin-key-btn {
  height: 52px;
  border: 1px solid var(--border-light, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  background: var(--bg-surface-elevated, #ffffff);
  color: var(--text-main, #1e293b);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.12s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.pin-key-btn:hover {
  background: var(--bg-surface, #f1f5f9);
  border-color: var(--border-color, #cbd5e1);
}

.pin-key-btn:active {
  transform: scale(0.93);
  background: var(--border-light, #e2e8f0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pin-key-btn.pin-key-action {
  font-size: 0.92rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted, #64748b);
  border-color: transparent;
}

.pin-key-btn.pin-key-action:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-main, #1e293b);
}

.pin-key-btn.pin-key-action:active {
  background: rgba(148, 163, 184, 0.3);
}

.pin-key-btn.pin-key-action i {
  font-size: 1.15rem;
}

