/* ──────────────────────────────────────────────
   後台管理介面樣式（admin.html 外殼 + 各模組）
   沿用 style.css 的品牌變數：香檳金 / 柔紫 / 暖米白
   ────────────────────────────────────────────── */

/* 官網 style.css 是「固定 header + body 上緣預留 70px」；後台自帶 sticky 頂列，不需要這段預留。
   admin.css 只被後台 / 預覽頁載入，不影響官網首頁。 */
body { padding-top: 0; }

/* ══════════════════════════════════════════════
   設計 Token（後台＋客人端共用）
   完整說明見 docs/介面樣式紀錄.md § UI 設計規範
   定義在 :root（客人端頁面沒有 .admin-shell 外殼，掛在 shell 上會整組失效
   → 標題縮小、角標放大，2026-07-10 老闆抓到的比例錯亂就是這個）
   ══════════════════════════════════════════════ */
:root,
.admin-shell {
  /* 字級階層 L1–L6（相鄰約 1.15–1.25×，勿跳太大） */
  --text-l1: 1.3rem;       /* 頁面主標「會員管理」 */
  --text-l1-sm: 1.22rem;   /* 手機 L1 */
  --text-l2: 1rem;         /* 區塊標、表單區標、清單摘要 */
  --text-l3: .98rem;       /* 卡片主資訊（姓名、商品名） */
  --text-l4: .94rem;       /* 內文、搜尋框、表單輸入 */
  --text-l5: .82rem;       /* 輔助說明、編號、建檔日 */
  --text-l6: .74rem;       /* 角標、小 tag、頁尾 meta */

  --fw-title: 700;
  --fw-emphasis: 600;
  --fw-body: 400;

  /* 文案 / 邊框（品牌色仍用 style.css 的 --primary-purple 等） */
  --text-muted: #8a8273;
  --text-muted-light: #9c9483;
  --border-card: #ece6da;
  --border-input: #e2dacb;

  /* 按鈕尺寸（後台 ≠ 官網 CTA 大膠囊） */
  --btn-radius: 12px;
  --btn-radius-pill: 999px;
  --btn-primary-py: 10px;
  --btn-primary-px: 18px;
  --btn-primary-size: .92rem;
  --btn-primary-py-sm: 9px;
  --btn-primary-px-sm: 15px;
  --btn-primary-size-sm: .88rem;
  --btn-ghost-py: 8px;
  --btn-ghost-px: 14px;
  --btn-ghost-size: .84rem;
  --btn-mini-py: 5px;
  --btn-mini-px: 11px;
  --btn-mini-size: .78rem;

  /* 區塊間距 */
  --space-page-head: 20px;
  --space-section: 16px;
  --space-card-gap: 14px;
  --radius-card: 16px;
  --radius-input: 12px;
}

/* ── 後台按鈕優先級（Primary / Secondary / Mini / Danger）── */
.admin-shell .btn.btn-gold,
.btn-admin-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--btn-primary-py) var(--btn-primary-px);
  font-size: var(--btn-primary-size);
  font-weight: var(--fw-emphasis);
  line-height: 1.25;
  border-radius: var(--btn-radius);
  background-color: var(--accent-gold);
  color: var(--white);
  border: 1px solid var(--accent-gold);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  font-family: inherit;
}
.admin-shell .btn.btn-gold:hover,
.btn-admin-primary:hover {
  background-color: var(--dark-purple);
  border-color: var(--dark-purple);
  transform: translateY(-1px);
}
.admin-shell .btn.btn-gold:disabled,
.btn-admin-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.admin-shell .btn.btn-gold i,
.btn-admin-primary i { font-size: .88em; }

.admin-shell .btn-ghost,
.btn-admin-secondary {
  padding: var(--btn-ghost-py) var(--btn-ghost-px);
  font-size: var(--btn-ghost-size);
  font-weight: var(--fw-emphasis);
  border-radius: var(--btn-radius);
  white-space: nowrap;
}
.admin-shell .btn-mini,
.btn-admin-mini {
  padding: var(--btn-mini-py) var(--btn-mini-px);
  font-size: var(--btn-mini-size);
  font-weight: var(--fw-emphasis);
  border-radius: 8px;
  font-family: inherit;
}

@media (max-width: 640px) {
  :root,
  .admin-shell {
    --text-l1: var(--text-l1-sm);
    --space-page-head: 16px;
  }
  .admin-shell .btn.btn-gold,
  .btn-admin-primary {
    padding: var(--btn-primary-py-sm) var(--btn-primary-px-sm);
    font-size: var(--btn-primary-size-sm);
  }
}

/* ── 外殼版面 ───────────────────────────────── */
.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-cream);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: var(--white);
  border-bottom: 1px solid #ece6da;
  position: sticky;
  top: 0;
  z-index: 30;
}
.admin-topbar .logo-text { font-size: 1.15rem; line-height: 1.1; white-space: nowrap; }
.admin-topbar .logo-sub  { display: block; font-size: .58rem; letter-spacing: 2px; color: var(--accent-gold); white-space: nowrap; }
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.admin-topbar-right .user-email { font-size: .85rem; color: #8a8273; }
.admin-burger { display: none; background: none; border: none; font-size: 1.3rem; color: var(--dark-purple); cursor: pointer; padding: 4px 8px; line-height: 1; }

.admin-body {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: 0;
}

/* ── 側邊選單 ───────────────────────────────── */
.admin-sidebar {
  flex: 0 0 218px;
  background: var(--white);
  border-right: 1px solid #ece6da;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #5d5647;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
}
.admin-nav-item i { width: 18px; text-align: center; color: var(--accent-gold); }
.admin-nav-item:hover { background: #f6f1e8; color: var(--dark-purple); }
.admin-nav-item.active { background: var(--primary-purple); color: var(--white); }
.admin-nav-item.active i { color: var(--white); }
.admin-nav-item.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }  /* 尚未實作的模組 */
.admin-nav-ext { font-size: .7rem; margin-left: auto; opacity: .55; }

/* 側邊欄頂端：登入者個人資料（頭像＋名字＋編輯）— 桌機固定欄與手機抽屜共用 */
.admin-nav-profile {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 6px 8px 15px; margin-bottom: 8px;
  border-bottom: 1px solid #f0ebe1; text-align: center;
}
.admin-nav-profile .avatar { box-shadow: 0 3px 10px rgba(106, 90, 138, .18); }
.anp-name { font-size: 1rem; font-weight: var(--fw-title); color: var(--dark-purple); line-height: 1.3; word-break: break-word; }
.anp-edit { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .8rem; padding: 7px 12px; }
.anp-edit i { font-size: .82em; }

/* 個人資料編輯 modal：靠左表單（沿用 .modal-* / .form-avatar / .form-field） */
.profile-edit-card { text-align: left; }
.profile-edit-card .form-avatar { margin: 4px 0 6px; }

/* ── 內容區 ─────────────────────────────────── */
.admin-content {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 60px;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: var(--space-page-head);
}
.admin-page-head h2 {
  font-size: var(--text-l1);
  font-weight: var(--fw-title);
  letter-spacing: .01em;
  line-height: 1.25;
  color: var(--dark-purple);
  margin: 0;
}
.admin-page-head .sub { color: var(--text-muted); font-size: var(--text-l5); margin-top: 5px; line-height: 1.5; }

/* ── 工具列（搜尋 + 動作） ─────────────────────── */
.admin-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.admin-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.admin-search i {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: #b6ac98;
  font-size: .9rem;
}
.admin-search input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  font-size: var(--text-l4);
  background: var(--white);
}
.admin-search input:focus { outline: none; border-color: var(--accent-gold); }

/* ── 資料表 ─────────────────────────────────── */
.data-table-wrap {
  background: var(--white);
  border: 1px solid #ece6da;
  border-radius: 14px;
  overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table thead th {
  text-align: left;
  padding: 13px 16px;
  background: #f7f2e9;
  color: #7a7160;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .5px;
  white-space: nowrap;
}
.data-table tbody td { padding: 13px 16px; border-top: 1px solid #f0ebe1; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: #faf6ef; }
.data-table .col-name { font-weight: 600; color: var(--dark-purple); }
.data-table .muted-cell { color: #b0a892; }

/* ── 狀態徽章 ───────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pregnant   { background: #efe7f7; color: #6a4f95; }
.badge-postpartum { background: #fbeede; color: #b07f33; }
.badge-general    { background: #eef0ef; color: #6c7a72; }

/* ── 表單 ───────────────────────────────────── */
.admin-form {
  background: var(--white);
  border: 1px solid #ece6da;
  border-radius: 14px;
  padding: 24px;
  max-width: 720px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: .85rem; color: #6f6757; font-weight: 600; }
.form-field label .req { color: #c2553f; margin-left: 2px; }
.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid #e2dacb;
  border-radius: 9px;
  font-size: .95rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text-charcoal);
}
.form-field textarea { resize: vertical; min-height: 84px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: var(--accent-gold); }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ── 會員檔案卡 ─────────────────────────────── */
.detail-card {
  background: var(--white);
  border: 1px solid #ece6da;
  border-radius: 14px;
  padding: 24px;
  max-width: 760px;
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f0ebe1;
}
.detail-head .detail-name { font-size: 1.3rem; font-weight: 700; color: var(--dark-purple); }
.detail-head .detail-actions { margin-left: auto; display: flex; gap: 8px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
}
.detail-row { display: flex; flex-direction: column; gap: 3px; }
.detail-row .k { font-size: .78rem; color: #9c9483; }
.detail-row .v { font-size: .98rem; color: var(--text-charcoal); }
.detail-row.full { grid-column: 1 / -1; }
.detail-row .v.note { white-space: pre-wrap; line-height: 1.55; }

.detail-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed #e7e0d3;
}
.detail-section h4 {
  font-size: .95rem;
  color: var(--dark-purple);
  margin: 0 0 10px;
}

/* ── 即將推出 / 空狀態 ─────────────────────────── */
.coming-soon,
.empty-state {
  background: var(--white);
  border: 1px dashed #ddd4c2;
  border-radius: 14px;
  padding: 50px 24px;
  text-align: center;
  color: #9c9483;
}
.coming-soon i, .empty-state i { font-size: 2.2rem; color: #d9cdb1; display: block; margin-bottom: 12px; }
.coming-soon h3 { color: var(--dark-purple); margin: 0 0 6px; font-size: 1.1rem; }
.coming-soon .phase-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f3eee4;
  color: var(--accent-gold);
  font-size: .78rem;
  font-weight: 600;
}

/* ── 行內提示 / 錯誤 ───────────────────────────── */
.inline-msg { padding: 30px; text-align: center; color: #9c9483; }
.inline-msg.error { color: #c2553f; }

/* ── 返回連結 ───────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary-purple);
  cursor: pointer;
  font-size: .9rem;
  padding: 0;
  margin-bottom: 14px;
}
.back-link:hover { color: var(--dark-purple); }

/* 手機抽屜背景遮罩：壓暗內容、擋住背景點擊；點遮罩可關閉（shell JS 動態插入 body） */
.admin-nav-backdrop {
  position: fixed;
  top: calc(var(--topbar-h, 54px) - 1px);   /* 與抽屜同高起算，頂列保持可點（☰ 可再關） */
  left: 0; right: 0; bottom: 0;
  background: rgba(45, 35, 22, .32);
  z-index: 39;                               /* 蓋過內容、墊在抽屜（z-40）下 */
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

/* ── 響應式：窄螢幕把側邊欄變成頂部橫向列 ──────────── */
@media (max-width: 820px) {
  .admin-body { flex-direction: column; position: relative; }
  /* 抽屜開啟：顯示遮罩＋鎖住背景捲動（桌機側欄是固定欄，不套用） */
  .admin-nav-backdrop.show { opacity: 1; pointer-events: auto; }
  body.nav-lock { overflow: hidden; }
  .admin-burger { display: inline-flex; align-items: center; }
  /* 窄螢幕頂列：縮小留白、標題不折行、隱藏 email 騰出空間給標題與登出鈕 */
  .admin-topbar { padding: 8px 14px; gap: 10px; }
  .admin-topbar .logo-text { font-size: .98rem; }
  .admin-topbar .logo-sub { font-size: .5rem; letter-spacing: 1.5px; }
  .admin-topbar-right { gap: 8px; }
  .admin-topbar-right .user-email { display: none; }
  /* 窄螢幕：☰ 展開為「浮動面板」，固定貼在頂列下方、捲動不跟背景動、蓋在內容前面 */
  .admin-sidebar {
    display: none;
    position: fixed;
    /* 上移 1px 蓋住頂列底線＋抽屜不留上邊框 → 與頂列無縫接合，消除左上角接縫 */
    top: calc(var(--topbar-h, 54px) - 1px);
    left: 0;
    z-index: 40;
    width: 230px;
    max-width: 86%;
    max-height: calc(100vh - var(--topbar-h, 54px) + 1px);
    overflow-y: auto;
    flex-direction: column;
    gap: 2px;
    background: var(--white);
    border-right: 1px solid #ece6da;   /* 左緣貼螢幕、上緣接頂列 → 只留右/下邊框 */
    border-bottom: 1px solid #ece6da;
    border-radius: 0 0 14px 0;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .14);
    padding: 8px;
  }
  .admin-sidebar.open { display: flex; }
  .admin-nav-item { width: 100%; }
  .admin-nav-ext { display: none; }
  .admin-content { padding: 14px 16px 50px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
}

/* ── 預覽橫幅樣式移至 css/style.css（讓所有預覽頁共用，含未載入 admin.css 的客人端）── */

/* ── 儀表板統計卡 ───────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--white);
  border: 1px solid #ece6da;
  border-radius: 14px;
  padding: 18px;
}
.stat-card .stat-label { font-size: .82rem; color: #9c9483; display: flex; align-items: center; gap: 7px; }
.stat-card .stat-label i { color: var(--accent-gold); }
.stat-card .stat-num { font-size: 1.7rem; font-weight: 700; color: var(--dark-purple); margin-top: 6px; }
.stat-card .stat-foot { font-size: .76rem; color: #b0a892; margin-top: 2px; }

/* ── 卡片區塊（儀表板兩欄） ───────────────────── */
.panel-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.admin-card {
  background: var(--white);
  border: 1px solid #ece6da;
  border-radius: 14px;
  padding: 18px 20px;
}
.admin-card h4 { margin: 0 0 12px; color: var(--dark-purple); font-size: 1rem; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid #f0ebe1; font-size: .9rem;
}
.alert-list li:first-child { border-top: none; }
.alert-list .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.warn { background: #e0a23b; }
.dot.info { background: var(--primary-purple); }
.dot.due  { background: #c98a8a; }

/* ── 營收長條 ───────────────────────────────── */
.bar-row { display: flex; align-items: center; gap: 12px; margin: 9px 0; font-size: .85rem; }
.bar-row .bar-label { width: 56px; color: #8a8273; }
.bar-row .bar-track { flex: 1; background: #f1ebdf; border-radius: 999px; height: 14px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-gold), #d9bd80); }
.bar-row .bar-val { width: 76px; text-align: right; color: #6f6757; }

/* ── 小型狀態徽章（通用） ───────────────────────── */
.badge-paid    { background: #e3f1e6; color: #4f8a5f; }
.badge-unpaid  { background: #fbe9e6; color: #b5524a; }
.badge-pending { background: #fbf2dd; color: #b07f33; }
.badge-active  { background: #e7eefb; color: #4f6aa0; }
.badge-type    { background: #f0ecf6; color: #74619c; }

/* ── LINE 登入按鈕（沿用 .btn-google 版面，換成 LINE 綠） ──── */
.btn-line-login { background: #06c755; border-color: #06c755; color: #fff; }
.btn-line-login:hover { background: #05b34c; border-color: #05b34c; box-shadow: 0 1px 6px rgba(6, 199, 85, .3); }
.btn-line-login i { font-size: 20px; line-height: 1; }

/* ── 預覽用：簡易提示 ───────────────────────────── */
.preview-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--dark-purple); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: .85rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 60;
}
.preview-toast.show { opacity: .96; }

@media (max-width: 820px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}

/* ── 營業時間設定卡（排班頁） ───────────────────── */
.hours-form { display: flex; flex-direction: column; gap: 16px; }
.hours-form .setting-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hours-form .setting-label { width: 76px; flex: none; font-size: .9rem; color: #6f6757; font-weight: 600; }
.hours-form label { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: #6f6757; }
.hours-form input[type="time"] { padding: 8px 10px; border: 1px solid #e2dacb; border-radius: 9px; font-size: .95rem; background: #fff; color: var(--text-charcoal); }
.hours-form input[type="time"]:focus { outline: none; border-color: var(--accent-gold); }

/* 分段按鈕（取代下拉選單） */
.segmented { display: inline-flex; border: 1px solid #e2dacb; border-radius: 10px; overflow: hidden; background: #fff; }
.segmented button { border: none; background: #fff; padding: 8px 16px; font-size: .9rem; color: #6f6757; cursor: pointer; border-left: 1px solid #eee4d2; }
.segmented button:first-child { border-left: none; }
.segmented button.active { background: var(--accent-gold); color: #fff; }

/* 即時時段預覽 */
.slot-preview { background: #faf6ee; border: 1px dashed #e2d6bb; border-radius: 12px; padding: 14px 16px; }
.slot-preview .sp-head { font-size: .88rem; color: #6f6757; margin-bottom: 8px; }
.slot-preview .sp-head b { color: var(--dark-purple); font-size: 1rem; }
.slot-preview .sp-list { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-preview .sp-list span { background: #fff; border: 1px solid #ece0c6; border-radius: 999px; padding: 3px 10px; font-size: .82rem; color: #7a7160; }
.slot-preview .sp-empty { color: #c2553f; font-size: .88rem; }
.setting-actions { margin-top: 2px; }

/* ── 可收合面板（營業時間設定＝設定一次，預設收起） ──── */
.panel-collapsible { padding: 0; overflow: hidden; }
.panel-toggle {
  width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  background: none; border: none; padding: 15px 18px; cursor: pointer;
  text-align: left; font-size: 1rem; color: var(--dark-purple);
}
.pt-head { display: flex; align-items: center; gap: 12px; }
.panel-toggle .pt-title { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.panel-toggle .pt-title i { color: var(--accent-gold); }
.panel-toggle .pt-caret { margin-left: auto; color: #b6ac98; transition: transform .2s; }
.panel-toggle[aria-expanded="true"] .pt-caret { transform: rotate(180deg); }
.pt-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-summary .sum-chip { background: #f3eee4; border-radius: 999px; padding: 3px 11px; font-size: .78rem; color: #8a8273; white-space: nowrap; }
.panel-body { padding: 0 18px 18px; }
.pt-hint { font-size: .82rem; color: #9c9483; margin: 0 0 14px; }

/* ── 月曆：快速公休 + 某天特殊營業時間 ───────────── */
.cal-toolbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; flex-wrap: wrap; }
.cal-hint { font-size: .82rem; color: #9c9483; }
#holiday-mode.on { background: #b5524a; border-color: #b5524a; color: #fff; }
.cal-day { position: relative; }
.cal-day.dayoff { background: #f3e9e7; color: #b5847b; }
.cal-day.past-view { cursor: pointer; }
.cal-day.past-view:hover { background: #efedea; }
.cal-day.rest { background: #faf7f7; }
.cal-day.rest-view { cursor: pointer; }
.cal-day.rest-view:hover { background: #f3eeee; }
/* 月曆角標：公休（右上）/ 非營業日（左上），與卡片 corner-tab 同一套語言 */
.cal-day .cal-tag {
  position: absolute; top: 0; font-size: .52rem; font-weight: 700;
  line-height: 1; padding: 2px 5px; letter-spacing: .02em; pointer-events: none;
}
.cal-day .cal-tag.right { right: 0; border-radius: 0 12px 0 8px; }
.cal-day .cal-tag.left  { left: 0;  border-radius: 12px 0 8px 0; }
.cal-tag.t-off  { background: #fdeae8; color: #c1574c; }   /* 公休 */
.cal-tag.t-rest { background: #eef0ef; color: #9aa29c; }   /* 非營業日（店休） */
.cal-tag.t-extra { background: #f7edd6; color: #9c7522; }  /* 單日臨時營業（加開） */
/* 日期面板狀態改用角標（與卡片 corner-tab 同一套，貼右上角；灰色沿用 t-gen / t-arch） */
.day-panel { position: relative; }
.corner-tab.t-off { background: #fdeae8; color: #c1574c; }   /* 整天公休 */
.corner-tab.t-extra { background: #f7edd6; color: #9c7522; } /* 單日臨時營業 */
.cal-day .cal-mark { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-gold); }
.special-hours { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #faf6ee; border: 1px dashed #e2d6bb; border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; }
.special-hours label { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: #6f6757; }
.special-hours input[type="time"] { padding: 6px 8px; border: 1px solid #e2dacb; border-radius: 8px; background: #fff; }
.hours-form select { padding: 8px 12px; border: 1px solid #e2dacb; border-radius: 9px; font-size: .92rem; background: #fff; color: var(--text-charcoal); }
.inline-field { font-size: .9rem; color: #6f6757; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.day-input { width: 56px; padding: 6px 8px; border: 1px solid #e2dacb; border-radius: 8px; text-align: center; font-size: .92rem; background: #fff; }

/* 收尾時段（太晚開始、做不完一場 → 灰色不可約，但顯示「還在工作」） */
.admin-cell.late { background: #f0eef2; color: #b3acba; }
/* 公休＝時間關閉：顯示時間但劃掉、灰色；可點一下重開 */
.admin-cell.closed { text-decoration: line-through; }
/* 服務中＝被前一場已約佔住，不可約 */
.admin-cell.busy { background: #f7eede; color: #bda77f; cursor: default; }
.admin-cell.busy:hover { background: #f7eede; }
/* 已過＝今天已經過掉的時段，不可約 */
.admin-cell.past { background: #f2f1f0; color: #bdbab5; cursor: default; }
.admin-cell.past:hover { background: #f2f1f0; }
.lg-busy { background: #e7d3a8 !important; }
.lg-past { background: #dcdad6 !important; }

/* 設為已約對話框（姓名 + 療程） */
.bk-field { display: block; text-align: left; font-size: .85rem; color: #6f6757; margin: 12px 0 0; }
.bk-field input, .bk-field select { width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #e2dacb; border-radius: 9px; font-size: .95rem; background: #fff; box-sizing: border-box; color: var(--text-charcoal); }
.bk-field input:focus, .bk-field select:focus { outline: none; border-color: var(--accent-gold); }
.bk-hint { text-align: left; font-size: .82rem; color: #9c9483; margin: 10px 0 2px; }
/* 多項目：加入服務列 + 已選清單 */
.bk-add { display: flex; gap: 8px; margin-top: 5px; }
.bk-add select { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid #e2dacb; border-radius: 9px; font-size: .9rem; background: #fff; }
.bk-add .btn-mini { flex: none; white-space: nowrap; }
.bk-items { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 2px; }
.bk-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f7f2e9; border: 1px solid #ece0c6; border-radius: 8px; padding: 7px 11px; font-size: .85rem; color: #6f6757; text-align: left; }
.bk-rm { border: none; background: none; color: #b5524a; cursor: pointer; font-size: .9rem; line-height: 1; }
.bk-empty { font-size: .82rem; color: #9c9483; text-align: left; }
.bk-warn { display: block; margin-top: 6px; color: #c2553f; font-weight: 600; }
.action-btn:disabled { opacity: .45; cursor: not-allowed; }

/* 商品建檔：類型篩選頁籤 + 上架勾選 */
.ptabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.ptab { border: 1px solid var(--border-input); background: #fff; color: #6f6757; border-radius: var(--btn-radius-pill); padding: 8px 15px; font-size: var(--text-l5); cursor: pointer; }
.ptab.on { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; }
.pf-check { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.pf-check input { width: auto; margin: 0; }
.pf-hint { font-size: .8rem; color: #9c9483; margin-top: 6px; }
.btn-danger { color: #c2553f; }
.btn-danger:hover { border-color: #c2553f; color: #c2553f; }

/* 商品清單：卡片格狀排版（桌機多欄、手機單欄） */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 12px; }
.prod-card {
  position: relative;
  text-align: left; font-family: inherit; background: var(--white);
  border: 1px solid #e6ddcb; border-radius: 14px; padding: 14px 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.prod-card:hover { border-color: var(--accent-gold); box-shadow: 0 5px 16px rgba(0,0,0,.07); }
.prod-card:active { transform: scale(.99); }
.prod-card.off { opacity: .55; }
.pc-top { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; padding-right: 56px; }   /* 名稱 + 類型 tag；右側讓出狀態角標 */
.pc-name { font-size: var(--text-l3); font-weight: var(--fw-title); color: var(--dark-purple); line-height: 1.3; }
.pc-meta { font-size: .8rem; color: #9c9483; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-spec { font-size: .92rem; color: #6f6757; display: flex; align-items: center; gap: 6px; }
.pc-spec i { color: #b6ac98; }
.pc-spec .price { margin-left: auto; color: var(--accent-gold); font-weight: 700; }
.pc-sub { font-size: .8rem; color: #9c9483; }
.pc-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.pc-meta i { color: #b6ac98; }

/* 會員檔案卡（profile） */
.profile-card { position: relative; background: var(--white); border: 1px solid #ece6da; border-radius: 16px; padding: 22px 24px; max-width: 780px; }
.profile-card.corner-top .profile-head { padding-top: 14px; }   /* 讓出角標空間 */
.profile-card.corner-top > .corner-tab:not(.left) + .profile-head { padding-right: 72px; }   /* 右上狀態角標（會員明細） */
.profile-card.corner-top > .corner-tab.left + .profile-head { padding-left: 4px; }   /* 左上狀態角標（預約／票券明細） */
.profile-card .corner-tab { border-radius: 0 16px 0 12px; }
.profile-card .corner-tab.left { border-radius: 16px 0 12px 0; }
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-id { min-width: 0; }
.profile-name { font-size: 1.35rem; font-weight: 700; color: var(--dark-purple); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-contact { font-size: .88rem; color: #8a8273; margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.profile-contact i { color: var(--accent-gold); margin-right: 4px; }
.profile-contact a { color: #8a8273; text-decoration: none; }
.profile-contact a:hover { color: var(--accent-gold); }
/* 操作區：獨立一列、與上方資料以細線分隔（不再被角標的右留白擠壓，桌機也用滿整寬）
   編輯／封存為主動作靠左；刪除是破壞性動作，降權靠右分離（避免誤觸） */
.profile-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #f0ebe1;
}
.profile-actions .pa-main { display: flex; gap: 8px; }
.profile-actions .btn-del {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: none;
  color: var(--text-muted-light);
  font-family: inherit; font-size: var(--btn-ghost-size); cursor: pointer;
  padding: var(--btn-ghost-py) 10px; border-radius: var(--btn-radius);
  transition: color .15s, background .15s;
}
.profile-actions .btn-del:hover { color: #c2553f; background: #fbeeeb; }
/* 窄畫面：主動作兩顆各半排填滿整列（消除落單空格）；刪除獨立一列、靠右、以細線分隔 */
@media (max-width: 640px) {
  .profile-actions { flex-wrap: wrap; gap: 10px; }
  .profile-actions .pa-main { width: 100%; gap: 8px; }
  .profile-actions .pa-main .btn-ghost { flex: 1 1 calc(50% - 4px); text-align: center; justify-content: center; }
  .profile-actions .btn-del {
    width: 100%; margin-left: 0; justify-content: flex-end;
    border-top: 1px solid #f0ebe1; border-radius: 0;
    padding-top: 12px; margin-top: 2px;
  }
  .profile-actions .btn-del:hover { background: none; }
}

.profile-alert { display: flex; gap: 10px; background: #fbf3e4; border: 1px solid #ecdcb6; border-radius: 12px; padding: 11px 14px; margin-top: 16px; font-size: .9rem; color: #7a6228; line-height: 1.55; }
.profile-alert i { color: #d09a2c; margin-top: 2px; flex: none; }
.profile-alert b { color: #6a5320; }

/* 會員資訊區：自適應卡片，桌機多欄 / 平板兩欄 / 手機單欄整齊不亂 */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.info-item {
  background: #faf6ee; border: 1px solid #efe6d3; border-radius: 11px; padding: 10px 14px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0;
}
.info-item .ik { font-size: .8rem; color: #9c9483; flex: none; }
.info-item .iv { font-size: .98rem; font-weight: 700; color: var(--dark-purple); text-align: right; word-break: break-word; min-width: 0; }
@media (max-width: 480px) { .info-grid { grid-template-columns: 1fr; } }

/* 標籤篩選列 */
.tagbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.tagf { border: 1px solid var(--border-input); background: #fff; border-radius: var(--btn-radius-pill); padding: 6px 13px; font-size: var(--text-l5); color: #7a7363; cursor: pointer; transition: all .15s; }
.tagf:hover { border-color: var(--accent-gold); }
.tagf.on { background: var(--accent-gold); border-color: var(--accent-gold); color: #fff; }
.tagf i { margin-right: 4px; }

/* 表單頭貼上傳 */
.form-avatar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.fa-side { display: flex; flex-direction: column; gap: 6px; }
.btn-file { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }

/* 標籤 */
.tag { display: inline-block; background: #eef0f6; color: #6a6f8a; border-radius: 6px; padding: 1px 8px; font-size: .72rem; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tag-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.tag-chip { border: 1px solid #e2dacb; background: #fff; border-radius: 999px; padding: 5px 13px; font-size: .85rem; color: #6f6757; cursor: pointer; transition: all .15s; }
.tag-chip:hover { border-color: var(--primary-purple); }
.tag-chip.on { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; }

/* 清單排序下拉 */
.sort-sel { padding: 10px 12px; border: 1px solid var(--border-input); border-radius: var(--radius-input); background: #fff; font-size: var(--text-l4); color: #6f6757; flex: none; }

/* 狀態流轉提醒（如預產期已過 → 轉產後） */
.profile-suggest { display: flex; align-items: center; gap: 10px; background: #eef3fb; border: 1px solid #cdddf2; border-radius: 12px; padding: 10px 14px; margin-top: 16px; font-size: .9rem; color: #3f5e8c; line-height: 1.5; }
.profile-suggest i { color: #4f6aa0; flex: none; }
.profile-suggest .btn-mini { margin-left: auto; flex: none; }

/* 分類分組標題 */
.cat-group { margin-bottom: 22px; }
.cat-head { font-size: 1rem; color: var(--dark-purple); font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.cat-head::before { content: ''; width: 4px; height: 15px; background: var(--accent-gold); border-radius: 2px; }
.cat-count { font-size: .78rem; color: #9c9483; font-weight: 400; }

/* 表單錯誤提示 */
.form-err { color: #b5524a; background: #fbe9e6; border: 1px solid #f1c9c2; border-radius: 9px; padding: 9px 12px; font-size: .88rem; margin: 4px 0 0; }
.form-err i { margin-right: 4px; }

/* 商品類型：卡片式選擇器
   grid 等分（原 flex 換行會讓落單那張撐滿整排、大小不一）；窄螢幕改 2×2 仍等分 */
.type-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 5px; }
@media (max-width: 520px) { .type-cards { grid-template-columns: repeat(2, 1fr); } }
.type-card {
  border: 1.5px solid #e6ddcb; border-radius: 12px;
  padding: 13px 10px; text-align: center; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.type-card i { display: block; font-size: 1.25rem; color: #c3b89c; margin-bottom: 7px; transition: color .15s; }
.type-card .tc-label { font-size: .92rem; color: #6f6757; }
.type-card:hover { border-color: #d8c89f; }
.type-card.active { border-color: var(--accent-gold); background: #fdf8ee; box-shadow: 0 0 0 2px rgba(197,160,101,.18); }
.type-card.active i { color: var(--accent-gold); }
.type-card.active .tc-label { color: var(--dark-purple); font-weight: 600; }
.slot-preview .sp-list span.sp-tail { background: #f1eef2; color: #b3acba; border-color: #e6e1ea; }
.slot-preview .sp-note { font-size: .8rem; color: #9c9483; margin-top: 8px; }
.lg-late { background: #d8d2dd !important; }

/* ============================================================
   會員管理 v2：清單卡片 / 孕期儀表板 / 資訊小卡 / 分組表單 / 確認彈窗
   （沿用品牌色：金 var(--accent-gold) + 紫 var(--primary-purple)/(--dark-purple)）
   ============================================================ */

/* 頭像尺寸修飾 */
.avatar.sm { width: 42px; height: 42px; font-size: 1.05rem; }
.avatar.md { width: 52px; height: 52px; font-size: 1.2rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.7rem; }

/* ── 會員清單卡片 ── */
.mem-card { position: relative; background: var(--white); border: 1px solid #efe7d8; border-radius: 16px; padding: 17px 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; box-shadow: 0 1px 2px rgba(80,60,30,.03); }
.mem-card:hover { box-shadow: 0 8px 22px rgba(120,100,70,.12); border-color: #e4d7bf; transform: translateY(-2px); }
.mem-card.off { opacity: .55; }
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-right: 60px; }
.mc-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mc-name { font-size: var(--text-l3); font-weight: var(--fw-title); color: var(--dark-purple); line-height: 1.2; }
.mc-no { font-size: var(--text-l6); color: #b7a988; letter-spacing: .04em; margin-top: 2px; }
.mc-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }

/* 右上角彩色角標（corner tab）— 會員依孕期階段、商品依販售狀態 */
.corner-tab { position: absolute; top: 0; right: 0; padding: 5px 12px; font-size: var(--text-l6); font-weight: var(--fw-title); letter-spacing: .02em; border-radius: 0 14px 0 12px; white-space: nowrap; }  /* nowrap：避免被擠壓時逐字直書 */
.mem-card .corner-tab { border-radius: 0 16px 0 12px; }   /* 會員卡圓角 16px */
.corner-tab.left { left: 0; right: auto; border-radius: 16px 0 12px 0; }   /* 改貼左上角（如明細頁狀態） */
.corner-tab.t-tri1 { background: #efe7f7; color: #6a4f95; }   /* 第一孕期 */
.corner-tab.t-tri2 { background: #e2f1f1; color: #2c7280; }   /* 第二孕期 */
.corner-tab.t-tri3 { background: #f7edd6; color: #9c7522; }   /* 第三孕期 */
.corner-tab.t-over { background: #fdeae8; color: #c1574c; }   /* 預產期已過 */
.corner-tab.t-post { background: #e6f3ec; color: #2c7b53; }   /* 產後 */
.corner-tab.t-gen  { background: #eef0ef; color: #6c7a72; }   /* 一般 */
.corner-tab.t-arch { background: #eef0ef; color: #9aa29c; }   /* 已封存 */
.corner-tab.s-active { background: #e6f3ec; color: #2c7b53; } /* 商品：上架中（公開） */
.corner-tab.s-internal { background: #e7eefb; color: #4f6aa0; } /* 商品：不公開（內部使用票券等） */
.corner-tab.s-off    { background: #eef0ef; color: #9aa29c; } /* 商品：已下架 */
/* 商品類型：名稱後方的小 tag（依類型配色） */
.pc-type { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.pc-type.ty-service { background: #efe7f7; color: #6a4f95; }  /* 療程 */
.pc-type.ty-addon   { background: #f7edd6; color: #9c7522; }  /* 加購 */
.pc-type.ty-package { background: #e2f1f1; color: #2c7280; }  /* 套票 */
.pc-type.ty-retail  { background: #e7eefb; color: #4f6aa0; }  /* 實體 */
.pc-type.ty-voucher { background: #f7e8ee; color: #a4527c; }  /* 票券（會員票券模組：非堂數型的抵用券） */
.mc-contact { display: flex; flex-direction: column; gap: 5px; font-size: var(--text-l5); color: #6f6757; font-weight: 500; }
.mc-contact i { width: 16px; text-align: center; margin-right: 5px; }
.mc-contact .fa-phone { color: var(--accent-gold); }
.mc-contact .fa-line { color: #06c755; }
.mc-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 11px; border-top: 1px solid #f1eadc; font-size: var(--text-l6); color: #ad9f82; }
.mc-due { font-weight: 700; color: var(--accent-gold); }

/* ── 會員清單：舒適分區版面（參考預約課程系統）── */
.mem-page-head { align-items: flex-end; }   /* 其餘沿用 .admin-page-head token */
.list-filter-card {
  background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 18px 18px 16px;
  margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(80, 60, 30, .04);
}
/* 搜尋列：搜尋框 + 「篩選」開關鈕（永遠可見，符合 80/20） */
.list-filter-card .filter-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.list-filter-card .admin-search { display: flex; align-items: stretch; min-width: 0; flex: 1; }
.list-filter-card .admin-search input {
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 14px 0 38px;
  line-height: 1.3;
}
.list-filter-card .sort-sel { padding: 0 32px 0 14px; min-height: 44px; box-sizing: border-box; min-width: 140px; }
/* 視圖切換（如預約管理的「清單/月曆」）放在搜尋列時，與搜尋框、篩選鈕對齊 */
.list-filter-card .filter-bar .tag-pick { margin-top: 0; align-items: center; flex-wrap: nowrap; flex: none; }
/* 篩選開關鈕 */
.list-filter-card .filter-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--border-input);
  background: #faf8f4;
  color: #6f6757;
  border-radius: var(--radius-input);
  font-size: var(--text-l5);
  font-weight: var(--fw-emphasis);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.list-filter-card .filter-toggle:hover { border-color: var(--accent-gold); }
.list-filter-card .filter-toggle.on { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; }
.list-filter-card .filter-toggle .caret { font-size: .7rem; transition: transform .2s; }
.list-filter-card .filter-toggle.on .caret { transform: rotate(180deg); }
.list-filter-card .filter-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-gold); color: #fff;
  font-size: .68rem; font-weight: var(--fw-title);
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.list-filter-card .filter-toggle.on .filter-count { background: #fff; color: var(--primary-purple); }
/* 收起時的條件摘要（讓使用者知道正在篩什麼） */
.list-filter-card .filter-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin-top: 12px;
}
.list-filter-card.open .filter-summary { display: none; }   /* 展開時不需摘要 */
.list-filter-card .fsum-chip {
  font-size: var(--text-l6); font-weight: var(--fw-emphasis);
  color: var(--dark-purple); background: #efe7f7;
  padding: 4px 11px; border-radius: 999px;
}
.list-filter-card .fsum-none { font-size: var(--text-l6); color: var(--text-muted-light); }
.list-filter-card .fsum-clear {
  border: none; background: none; cursor: pointer;
  font-size: var(--text-l6); font-weight: var(--fw-emphasis);
  color: var(--primary-purple); font-family: inherit;
  padding: 2px 4px; text-decoration: underline;
}
/* 可收合內容 */
.list-filter-card .filter-body { display: none; }
.list-filter-card.open .filter-body { display: block; }
.list-filter-card .filter-sort .sort-sel { width: 100%; min-height: 40px; }
/* 篩選分組（Miller's Law：狀態 / 標籤分塊 + 小標） */
.list-filter-card .filter-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0ebe1;
}
.list-filter-card .filter-body > .filter-group:first-child {
  margin-top: 14px;
  padding-top: 14px;
}
.list-filter-card .filter-label {
  font-size: .76rem;
  font-weight: var(--fw-emphasis);
  color: var(--text-muted);
  letter-spacing: .04em;
  margin-bottom: 9px;
}
/* 窄螢幕橫向滑動＋顯示細捲軸（滑鼠可拖、觸控可滑）；桌機自動換行。
   ⚠️ 捲軸不可隱藏（scrollbar-width:none）：縮窄視窗沒觸控可滑時，超出的 pill 會點不到 */
.list-filter-card .filter-group { position: relative; }
.list-filter-card .filter-scroll {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;                  /* 留捲軸空間，避免壓到 pill */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;                /* Firefox：細捲軸 */
  scrollbar-color: #ddd3c2 transparent;
}
.list-filter-card .filter-scroll::-webkit-scrollbar { height: 6px; }
.list-filter-card .filter-scroll::-webkit-scrollbar-track { background: transparent; }
.list-filter-card .filter-scroll::-webkit-scrollbar-thumb { background: #ddd3c2; border-radius: 999px; }
.list-filter-card .filter-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }
.list-filter-card .filter-scroll.ptabs,
.list-filter-card .filter-scroll.tagbar { margin: 0; }
@media (min-width: 641px) {
  .list-filter-card .filter-scroll { flex-wrap: wrap; overflow-x: visible; padding-bottom: 2px; }
}
/* 篩選 pill：25–45 客群 — 輕巧好讀、點得到（36px / 手機 40px） */
.list-filter-card .ptab,
.list-filter-card .tagf {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 7px 14px;
  font-size: .84rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.list-filter-card .ptab { border: 1px solid var(--border-input); background: #faf8f4; color: #6f6757; border-radius: var(--btn-radius-pill); }
.list-filter-card .ptab:hover { border-color: #d8cdb8; background: #fff; }
.list-filter-card .ptab.on { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; }
.list-filter-card .ptab.on .ptab-n { background: rgba(255,255,255,.22); color: #fff; }
.list-filter-card .ptab-n {
  font-size: .7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ece6da;
  color: #8a8273;
  font-variant-numeric: tabular-nums;
}
.list-filter-card .tagf { border: 1px solid var(--border-input); background: #faf8f4; color: #7a7363; border-radius: var(--btn-radius-pill); }
.list-filter-card .tagf:hover { border-color: var(--accent-gold); color: #6f6757; }
.list-filter-card .tagf.on { background: var(--accent-gold); border-color: var(--accent-gold); color: #fff; }
.list-filter-card .tagf.on i { color: #fff; }
.list-filter-card .tagf i { font-size: .88em; color: var(--accent-gold); }
@media (max-width: 640px) {
  .list-filter-card { padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; }
  .list-filter-card .ptab,
  .list-filter-card .tagf { min-height: 40px; padding: 8px 16px; }
  /* 手機：篩選鈕只留圖示（＋數量角標、箭頭），「篩選」文字視覺隱藏但保留給螢幕閱讀器 */
  .list-filter-card .filter-toggle { padding: 0 13px; }
  .list-filter-card .filter-toggle > span:not(.filter-count) {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}
.mem-list-head {
  font-size: var(--text-l2);
  font-weight: var(--fw-title);
  color: var(--dark-purple);
  margin: 0 0 14px;
  padding: 0 2px;
}
.mem-stack { display: flex; flex-direction: column; gap: var(--space-card-gap); }
.mem-card-row {
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.mcr-thumb {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 16px 16px;
}
.mcr-main {
  flex: 1;
  min-width: 0;
  padding: 14px 72px 14px 12px;   /* 右側讓出 corner-tab（格式塔：狀態與內容分組） */
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mcr-id { min-width: 0; }
.mc-contact-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.mem-card-row .mc-foot { margin-top: auto; padding-top: 10px; }
@media (max-width: 640px) {
  .mem-stack { gap: 12px; }
  .mcr-thumb { padding: 14px 0 14px 14px; }
  .avatar.md { width: 48px; height: 48px; font-size: 1.1rem; }
  .mcr-main { padding: 12px 64px 12px 10px; gap: 7px; }
  .profile-card.corner-top > .corner-tab:not(.left) + .profile-head { padding-right: 64px; }
  .mc-contact-row { flex-direction: column; gap: 5px; }
}

/* ── 孕期時程儀表板 ── */
.preg-tracker { background: linear-gradient(120deg, #fdf8ef, #f7eeda); border: 1px solid #e8d8b6; border-radius: 16px; padding: 20px 22px; margin-top: 18px; }
.pt-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.pt-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; background: var(--accent-gold); color: #fff; padding: 3px 10px; border-radius: 999px; }
.pt-h3 { font-size: 1.05rem; font-weight: 800; color: var(--dark-purple); margin: 9px 0 0; }
.pt-figs { display: flex; gap: 18px; }
.pt-fig { border-left: 2px solid #e4d2aa; padding-left: 13px; }
.pt-fig .l { font-size: .7rem; color: #a98c52; }
.pt-fig .v { font-size: 1.1rem; font-weight: 800; color: var(--dark-purple); margin-top: 3px; }
.pt-bar { height: 10px; background: #ecdfc4; border-radius: 999px; overflow: hidden; }
.pt-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-purple), var(--accent-gold)); border-radius: 999px; }
.pt-scale { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 9px; font-size: .68rem; color: #a08c63; }
.pt-scale b { display: block; color: #8a7547; font-weight: 700; font-size: .72rem; }
.pt-scale .mid { text-align: center; } .pt-scale .rgt { text-align: right; }
.pt-now { margin-top: 12px; padding-top: 11px; border-top: 1px dashed #e4d2aa; font-size: .82rem; color: var(--dark-purple); font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pt-now i { color: var(--accent-gold); }

/* ── 區段小標 ── */
.sec-label { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a9925f; margin: 24px 0 0; display: flex; align-items: center; gap: 7px; }
.sec-label i { color: var(--accent-gold); }

/* ── 行政資訊小卡（帶 icon）── */
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.info-card { background: #fffdf9; border: 1px solid #efe6d3; border-radius: 13px; padding: 14px 15px; }
.ic-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.ic-ico { width: 28px; height: 28px; border-radius: 50%; background: #f3ead7; color: var(--accent-gold); display: flex; align-items: center; justify-content: center; font-size: .78rem; flex: none; }
.ic-label { font-size: .74rem; color: #9c9483; }
.ic-val { font-size: .98rem; font-weight: 700; color: var(--dark-purple); word-break: break-word; }

/* ── 明細雙欄模組區 ── */
.detail-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }

/* ── 分組表單卡 ── */
.form-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.fgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.fgroup { background: #fcfaf5; border: 1px solid #efe6d3; border-radius: 14px; padding: 18px; }
.fgroup-h { font-size: .73rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dark-purple); border-bottom: 1px solid #ece3d0; padding-bottom: 10px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.fgroup-h i { color: var(--accent-gold); }
.fgroup .form-field { margin-bottom: 13px; }
.fgroup .form-field:last-child { margin-bottom: 0; }

/* icon 輸入框 */
.in-icon { display: flex; align-items: center; background: var(--white); border: 1px solid #e2dacb; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.in-icon:focus-within { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(197,160,101,.13); }
.in-icon > i { padding: 0 9px 0 13px; color: #c3b48f; font-size: .9rem; flex: none; }
.in-icon > i.fa-line { color: #06c755; }
.in-icon input { border: none; background: transparent; flex: 1; min-width: 0; padding: 10px 13px 10px 0; outline: none; font-size: .92rem; color: #4a4233; }
.in-hint { font-size: .72rem; color: #9c9483; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.in-hint i { color: var(--accent-gold); }
.field-due.due-hot { background: #fdf6ea; border: 1px solid #f0dcb4; border-radius: 11px; padding: 11px 12px; margin: -11px -12px; }
.field-due.due-hot .in-icon { border-color: var(--accent-gold); }
.due-flag { display: none; font-size: .68rem; font-weight: 700; color: #b07d22; margin-left: 6px; }
.field-due.due-hot .due-flag { display: inline; }

.no-chip { font-size: .74rem; font-weight: 700; color: var(--dark-purple); background: #f3ead7; padding: 5px 12px; border-radius: 999px; }

/* ── 自製確認彈窗（取代 confirm()）── */
.modal-overlay { position: fixed; inset: 0; background: rgba(45,35,22,.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 1100; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-card { background: var(--white); border-radius: 18px; max-width: 420px; width: 100%; padding: 24px; box-shadow: 0 20px 55px rgba(60,45,25,.3); transform: scale(.95); transition: transform .2s; }
.modal-overlay.show .modal-card { transform: scale(1); }
.modal-ico { width: 48px; height: 48px; border-radius: 50%; background: #fdeae8; color: #d2685f; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 14px; }
.modal-card h3 { margin: 0 0 8px; color: #3a3128; font-size: 1.1rem; }
.modal-card p { font-size: .88rem; color: #8a8273; line-height: 1.65; margin: 0 0 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   預約管理：日期分組 / 預約卡 / 狀態角標 / 付款徽章 / 服務項目清單
   ============================================================ */
/* 日期分組標題 */
.date-group { margin-bottom: 22px; }
.date-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 1rem; font-weight: 700; color: var(--dark-purple); margin: 0 0 12px; padding-bottom: 7px; border-bottom: 1px solid #ece3d0; }
.date-head .dh-sum { font-size: .8rem; color: #9c9483; font-weight: 500; }
.date-head .dh-today { display: inline-block; font-size: .68rem; font-weight: 700; color: #fff; background: var(--primary-purple); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

/* 預約卡 */
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.bk-card { position: relative; background: var(--white); border: 1px solid #efe7d8; border-radius: 14px; padding: 15px 16px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; box-shadow: 0 1px 2px rgba(80,60,30,.03); }
.bk-card:hover { box-shadow: 0 8px 22px rgba(120,100,70,.12); border-color: #e4d7bf; transform: translateY(-2px); }
.bk-card.dim { opacity: .58; }
.bkc-mem { display: flex; align-items: center; gap: 10px; padding-right: 64px; }
.bkc-name { font-weight: 700; color: var(--dark-purple); line-height: 1.2; }
.bkc-sub { font-size: .76rem; color: #9c9483; margin-top: 2px; }
.bkc-time { font-size: .92rem; color: var(--dark-purple); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.bkc-time i { color: var(--primary-purple); }
.bkc-items { font-size: .85rem; color: #6f6757; line-height: 1.45; }
.bkc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid #f1eadc; }
.bkc-price { font-weight: 700; color: var(--accent-gold); }

/* 付款徽章 */
.pay { font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 6px; white-space: nowrap; }
.pay-paid { background: #e6f3ec; color: #2c7b53; }
.pay-unpaid { background: #fdeae8; color: #c1574c; }
.pay-package { background: #efe7f7; color: #6a4f95; }
.pay-refunded { background: #e7eefb; color: #4f6aa0; }  /* 已退款（訂單） */

/* 預約狀態角標 */
.corner-tab.b-pending   { background: #f7edd6; color: #9c7522; }  /* 待確認 */
.corner-tab.b-confirmed { background: #efe7f7; color: #6a4f95; }  /* 已確認 */
.corner-tab.b-done      { background: #e6f3ec; color: #2c7b53; }  /* 已完成 */
.corner-tab.b-cancelled { background: #eef0ef; color: #9aa29c; }  /* 已取消 */
.corner-tab.b-noshow    { background: #fdeae8; color: #c1574c; }  /* 未到 */

/* 服務項目清單（detail） */
.bk-items-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bki-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 13px; background: #faf6ee; border: 1px solid #efe6d3; border-radius: 9px; font-size: .92rem; color: #5a5344; }
.bki-row .min { color: #9c9483; font-size: .82rem; font-weight: 400; }
.bki-row .p { color: var(--accent-gold); font-weight: 700; }
.bki-total { display: flex; justify-content: space-between; gap: 10px; padding: 10px 13px; margin-top: 4px; font-weight: 700; color: var(--dark-purple); border-top: 1px dashed #e4d2aa; }
.bki-total .price { color: var(--accent-gold); font-size: 1.05rem; }

/* 預約資訊：票券摘要橫幅（淡紫色系，與品牌紫一致）*/
.bk-ticket { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 26px; margin-top: 12px; padding: 18px 22px; border: 1px solid #ddd3ec; border-radius: 14px; background: linear-gradient(115deg, #f5f2fb 0%, #ebe5f5 100%); }
.tk-main { display: flex; flex-direction: column; gap: 4px; }
.tk-date { font-size: .82rem; font-weight: 700; color: #8779ac; display: flex; align-items: center; gap: 7px; }
.tk-date i { color: var(--primary-purple); }
.tk-time { font-size: 1.5rem; font-weight: 800; color: var(--dark-purple); letter-spacing: .01em; line-height: 1.1; }
.tk-div { align-self: stretch; width: 1px; margin: 2px 0; background: repeating-linear-gradient(#cbbfe4 0 4px, transparent 4px 8px); }
.tk-meta { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.tk-cell .tk-l { font-size: .72rem; color: #9a8fbb; }
.tk-cell .tk-v { font-size: 1.02rem; font-weight: 800; color: var(--dark-purple); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.tk-cell .tk-v i { color: var(--primary-purple); }
@media (max-width: 560px) { .tk-div { display: none; } .tk-meta { margin-left: 0; width: 100%; gap: 22px; } }

/* 客人身分小 tag（接在名字後；比 .badge 小一號、方角）*/
.stag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; vertical-align: middle; }
.stag.s-preg { background: #efe7f7; color: #6a4f95; }   /* 孕期中 */
.stag.s-post { background: #fbeede; color: #b07f33; }   /* 產後 */
.stag.s-gen  { background: #eef0ef; color: #6c7a72; }   /* 一般 / 臨時客 */
.stag.s-unmatch { background: #e7eefb; color: #4f6aa0; } /* 未對應（匯款：還不知道是哪位會員） */

/* 預約時段挑選（接排班可約時段 + 重疊檢查）*/
.slot-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.slot-row input[type="time"] { padding: 9px 11px; border: 1px solid #e2dacb; border-radius: 9px; font-size: .95rem; font-family: inherit; }
.slot-or { font-size: .82rem; color: #9c9483; }
.slot-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.slot-chip { border: 1px solid #e2dacb; background: var(--white); border-radius: 8px; padding: 6px 11px; font-size: .85rem; color: #6f6757; cursor: pointer; font-variant-numeric: tabular-nums; transition: all .12s; }
.slot-chip:hover { border-color: var(--primary-purple); }
.slot-chip.on { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; }
.slot-none { font-size: .85rem; color: #b07f33; }
.bk-warn { color: #c1574c; font-weight: 700; margin-left: 4px; }

/* 套票扣堂提示 */
.pkg-ok { color: #2c7b53; font-weight: 700; }
.pkg-ok i { color: var(--primary-purple); margin-right: 5px; }
.pkg-line { margin-top: 12px; font-size: .88rem; color: var(--dark-purple); font-weight: 600; background: #f3f0f9; border: 1px solid #ddd3ec; border-radius: 9px; padding: 9px 13px; }
.pkg-line i { color: var(--primary-purple); margin-right: 6px; }

/* 修正：自訂 display:flex 會蓋掉 hidden 屬性的 display:none → 全域補強 */
[hidden] { display: none !important; }

/* 預約月曆視圖（格內直接顯示當天客人）*/
.bkcal-wrap { margin: 0 auto; }
.bkcal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin: 4px 0 12px; font-size: .74rem; color: #6f6757; }
.bkcal-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.bkcal-legend .lg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-dot.s-pending   { background: #d6a32f; }
.lg-dot.s-confirmed { background: #9686b8; }
.lg-dot.s-done      { background: #3fae73; }
.lg-dot.s-cancelled { background: #b9b3a5; }
.lg-dot.s-noshow    { background: #d2685f; }

.bkcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; }
.bkcal-wd { text-align: center; font-size: .78rem; color: #9c9483; font-weight: 600; padding: 2px 0 4px; }
.bkcal-wd.wend { color: var(--primary-purple); }
.bkcal-day { min-height: 108px; border: 1px solid #efe7d8; border-radius: 10px; padding: 6px; background: var(--white); cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .12s, box-shadow .12s; overflow: hidden; }
.bkcal-day:hover { border-color: var(--accent-gold); }
.bkcal-day.empty { border: none; background: transparent; cursor: default; }
.bkcal-day.wend { background: #faf8f4; }
.bkcal-day.closed { background: #f4f2ee; }
.bkcal-day.sel { border-color: var(--primary-purple); box-shadow: 0 0 0 2px rgba(150,134,184,.25); }
.bkcal-top { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.bkcal-day .dnum { font-size: .82rem; font-weight: 700; color: #6f6757; line-height: 1.5; }
.bkcal-day.today .dnum { color: #fff; background: var(--primary-purple); border-radius: 6px; padding: 0 7px; }
.bkcal-num { font-size: .66rem; font-weight: 700; color: #fff; background: #c8beae; border-radius: 999px; padding: 1px 7px; flex: none; white-space: nowrap; }
/* 公休：放在格子內整列置中，窄畫面也不會被擠到截斷 */
.bkcal-off { font-size: .7rem; font-weight: 700; color: #a89e8d; background: #ece7dd; border-radius: 6px; text-align: center; padding: 2px 0; margin-top: 2px; white-space: nowrap; }

.bkcal-evt { display: flex; align-items: center; gap: 5px; font-size: .72rem; line-height: 1.4; border-radius: 6px; padding: 2px 6px; cursor: pointer; overflow: hidden; border-left: 3px solid #ccc; background: #f4f1ea; }
.bkcal-evt:hover { filter: brightness(.97); }
.bkcal-evt .ev-t { font-weight: 700; color: #6f6757; flex: none; font-variant-numeric: tabular-nums; }
.bkcal-evt .ev-n { color: var(--text-charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkcal-evt.dim { opacity: .55; }
.bkcal-evt.dim .ev-n { text-decoration: line-through; }
.bkcal-evt.s-pending   { background: #fbf3df; border-left-color: #d6a32f; }
.bkcal-evt.s-confirmed { background: #f0edf7; border-left-color: #9686b8; }
.bkcal-evt.s-done      { background: #e8f6ee; border-left-color: #3fae73; }
.bkcal-evt.s-cancelled { background: #f3f1ec; border-left-color: #b9b3a5; }
.bkcal-evt.s-noshow    { background: #fbeceb; border-left-color: #d2685f; }
.bkcal-more { font-size: .68rem; color: var(--primary-purple); font-weight: 600; padding: 1px 2px; margin-top: auto; }

/* 窄畫面（手機）：壓縮一切留白，把空間全留給客人姓名，3 字名可完整顯示 */
@media (max-width: 760px){
  .bkcal-grid { gap: 2px; }
  .bkcal-day { min-height: 82px; padding: 2px; border-radius: 8px; gap: 2px; }
  .bkcal-top { min-height: 16px; }
  .bkcal-day .dnum { font-size: .76rem; line-height: 1.3; }
  .bkcal-day.today .dnum { padding: 0 5px; }
  .bkcal-evt { padding: 1px 3px; font-size: .64rem; gap: 0; border-left-width: 3px; border-radius: 5px; }
  .bkcal-evt .ev-t { display: none; }
  .bkcal-evt .ev-n { width: 100%; }
  .bkcal-num { padding: 0 5px; font-size: .6rem; }
  .bkcal-off { font-size: .62rem; padding: 1px 0; }
  .bkcal-more { font-size: .62rem; }
  .bkcal-legend { gap: 5px 10px; font-size: .68rem; }
}

/* 預約進階篩選列 */
.adv-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }

/* 「篩選」收合鈕 + 進階篩選面板（把期間/服務/標籤收起來，畫面不雜）*/
.admin-toolbar .tag-pick { margin-top: 0; }   /* 與搜尋框、篩選鈕對齊 */
.bk-filter-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e2dacb; background: #fff; border-radius: 999px; padding: 8px 15px; font-size: .88rem; color: #6f6757; cursor: pointer; transition: all .15s; flex: none; font-family: inherit; white-space: nowrap; }
.bk-filter-btn:hover { border-color: var(--accent-gold); }
.bk-filter-btn.on { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; }
.bk-filter-btn .caret { font-size: .7rem; transition: transform .2s; }
.bk-filter-btn.on .caret { transform: rotate(180deg); }
.bk-fcount { background: var(--accent-gold); color: #fff; font-size: .7rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.bk-filter-btn.on .bk-fcount { background: #fff; color: var(--primary-purple); }
.bk-adv { display: none; background: #faf8f4; border: 1px solid #efe7d8; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.bk-adv.open { display: block; }
.bk-adv .adv-filter { margin: 0; }
.bk-adv .tagbar { margin: 12px 0 0; }
/* 手機：藏掉冗長副標、篩選鈕貼右，畫面更清爽 */
@media (max-width: 640px){
  .admin-page-head .sub { display: none; }
  .admin-toolbar .bk-filter-btn { margin-left: auto; }
  /* 標題區更緊湊：標題與新增鈕同排、間距收斂，讓清單更快進入視野 */
  .admin-page-head { margin-bottom: 14px; }
  .mem-page-head { align-items: center; }
}

/* 訂單付款狀態角標 */
.corner-tab.o-unpaid { background: #f7edd6; color: #9c7522; }  /* 待付款 */
.corner-tab.o-paid   { background: #e6f3ec; color: #2c7b53; }  /* 已付款 */
.corner-tab.o-void   { background: #eef0ef; color: #9aa29c; }  /* 作廢 */
/* 訂單品項數量輸入 */
.qty-input { width: 64px; padding: 9px 8px; border: 1px solid #e2dacb; border-radius: 9px; font-size: .92rem; text-align: center; }

/* 訂單已退款角標 + 退貨列 */
.corner-tab.o-refunded { background: #e7eefb; color: #4f6aa0; }  /* 已退款 */
.rf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; background: #faf6ee; border: 1px solid #efe6d3; border-radius: 9px; margin-bottom: 6px; }
.rf-row .rf-qty { font-size: .85rem; color: #6f6757; white-space: nowrap; }
.rf-row .rf-input { width: 58px; }
.refund-line { margin-top: 10px; padding: 10px 13px; background: #fdeae8; border: 1px solid #f3c9c4; border-radius: 9px; font-size: .88rem; color: #a23b32; line-height: 1.55; }
.refund-line i { margin-right: 5px; }

/* 套票/堂數：狀態角標 + 堂數進度條 */
.corner-tab.p-active   { background: #e6f3ec; color: #2c7b53; }  /* 使用中 */
.corner-tab.p-expiring { background: #f7edd6; color: #9c7522; }  /* 即將到期 */
.corner-tab.p-usedup   { background: #eef0ef; color: #9aa29c; }  /* 已用完 */
.corner-tab.p-expired  { background: #fdeae8; color: #c1574c; }  /* 已過期 */
.sess-line { display: flex; align-items: center; gap: 12px; }
.sess-num { font-size: .9rem; color: var(--dark-purple); white-space: nowrap; }
.sess-num b { font-size: 1.15rem; color: var(--accent-gold); }
.sess-bar { flex: 1; height: 8px; background: #ece3d0; border-radius: 999px; overflow: hidden; }
.sess-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-purple), var(--accent-gold)); border-radius: 999px; }
.sess-big { font-size: 2.2rem; font-weight: 800; color: var(--dark-purple); line-height: 1; }
.sess-big small { font-size: 1rem; color: #9c9483; font-weight: 600; }

/* 會員票券：到期提醒橫幅 + 調整紀錄列 */
.expiry-alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fdf6ea; border: 1px solid #f0dcb4; border-radius: 12px; padding: 11px 15px; margin-bottom: 14px; font-size: .9rem; color: #9c7522; }
.expiry-alert > i { color: #d09a2c; }
.expiry-alert .ea-act { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.adj-row { display: flex; gap: 12px; padding: 9px 13px; background: #faf6ee; border: 1px solid #efe6d3; border-radius: 8px; margin-bottom: 6px; font-size: .85rem; color: #5a5344; }
.adj-row .adj-date { color: #9c9483; white-space: nowrap; flex: none; }
.adj-row .adj-by { color: #9c9483; margin-left: auto; flex: none; }

/* 總覽 dashboard */
.dot.warn { background: #d6a32f; }
.dot.info { background: #4f6aa0; }
.dot.due  { background: #c1574c; }
.dot.ok   { background: #3fae73; }
a.stat-card { text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
a.stat-card:hover { border-color: var(--accent-gold); box-shadow: 0 5px 16px rgba(0,0,0,.06); transform: translateY(-1px); }
.alert-list li a { display: flex; align-items: center; gap: 9px; width: 100%; text-decoration: none; color: inherit; }
.alert-list li a .al-go { margin-left: auto; font-size: .78rem; color: var(--accent-gold); white-space: nowrap; }
.alert-list li:hover { background: #faf6ef; }
.alert-list li { padding-left: 4px; padding-right: 4px; border-radius: 8px; }
.card-link { display: block; text-align: right; margin-top: 10px; font-size: .82rem; color: var(--primary-purple); text-decoration: none; }
.card-link:hover { color: var(--dark-purple); }
.mini-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.mini-stats .ms { }
.mini-stats .ms-num { font-size: 1.35rem; font-weight: 800; color: var(--dark-purple); }
.mini-stats .ms-num small { font-size: .85rem; color: var(--accent-gold); font-weight: 700; }
.mini-stats .ms-label { font-size: .78rem; color: #9c9483; margin-top: 2px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.quick-link { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 16px 8px; border: 1px solid #efe7d8; border-radius: 12px; background: var(--white); text-decoration: none; color: var(--dark-purple); font-size: .88rem; font-weight: 600; transition: all .15s; }
.quick-link:hover { border-color: var(--accent-gold); background: #fffdf9; transform: translateY(-2px); }
.quick-link i { font-size: 1.4rem; color: var(--accent-gold); }
.dash-today-row { cursor: pointer; }

/* 總覽：兩排面板之間拉開距離 */
.panel-grid + .panel-grid { margin-top: 20px; }

/* 匯款對帳狀態角標 */
.corner-tab.pay-pending  { background: #f7edd6; color: #9c7522; }  /* 待對帳 */
.corner-tab.pay-matched  { background: #e6f3ec; color: #2c7b53; }  /* 已對帳 */
.corner-tab.pay-abnormal { background: #fceae7; color: #c2553f; }  /* 異常 */

/* 營收統計：熱門項目 Top 列 */
.rev-top-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid #f0ebe1; }
.rev-top-row:first-child { border-top: none; }
.rev-rank { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: #f3eee4; color: var(--accent-gold); font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.rev-name { flex: 1; min-width: 0; color: var(--text-charcoal); }
.rev-cnt { color: #9c9483; font-size: .85rem; white-space: nowrap; }
.rev-amt { font-weight: 700; color: var(--dark-purple); white-space: nowrap; }

/* 營收統計：直條圖（逐日／逐月趨勢）*/
.col-chart { display: flex; align-items: flex-end; gap: 5px; height: 150px; padding-bottom: 20px; overflow-x: auto; }
.cc-col { flex: 1 1 0; min-width: 15px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.cc-bar { width: 60%; max-width: 30px; min-height: 2px; background: linear-gradient(180deg, #d9bd86, #c5a065); border-radius: 5px 5px 0 0; }
.cc-x { position: absolute; bottom: -18px; font-size: .68rem; color: #9c9483; white-space: nowrap; }
.rev-newret { display: flex; gap: 8px; }
.rev-newret .nr { flex: 1; background: #faf7f0; border: 1px solid #f0e9da; border-radius: 10px; padding: 10px 12px; }
.rev-newret .nr-num { font-weight: 800; color: var(--dark-purple); font-size: 1.05rem; }
.rev-newret .nr-l { font-size: .78rem; color: #9c9483; margin-top: 2px; }

/* 營收統計：頂層區塊統一上下間距（取代各自不一的 margin）*/
.rev-wrap > * { margin: 0 0 18px; }
.rev-wrap > *:last-child { margin-bottom: 0; }
.rev-wrap .panel-grid + .panel-grid { margin-top: 0; }

/* 促銷活動狀態角標 */
.corner-tab.pr-active    { background: #e6f3ec; color: #2c7b53; }  /* 進行中 */
.corner-tab.pr-scheduled { background: #e7eefb; color: #4f6aa0; }  /* 排程中 */
.corner-tab.pr-ended     { background: #eef0ef; color: #9aa29c; }  /* 已結束 */
.corner-tab.pr-off       { background: #f3eceb; color: #b2796f; }  /* 停用 */

/* 活動優惠：明細/表單元件（自 preview/promotions.html 內嵌樣式搬入） */
.bn-poster-frame { position: relative; border: 1px dashed #d9cfc0; border-radius: 12px; background: #faf6ee; overflow: hidden; aspect-ratio: 4/5; max-width: 240px; display: flex; align-items: center; justify-content: center; }
.bn-poster-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-detail-stage { text-align: center; background: linear-gradient(135deg, #fff8f0, #f6f0fa); border: 1px solid #efe6d3; border-radius: 16px; padding: 22px 18px; margin-top: 10px; }
.bn-detail-stage .bn-eyebrow { display: inline-block; margin-bottom: 10px; padding: 4px 14px; border-radius: 999px; background: rgba(197, 160, 101, .14); color: var(--accent-gold); font-size: .7rem; letter-spacing: 2px; }
.bn-detail-stage .bn-d-title { font-size: 1.3rem; color: var(--dark-purple); font-weight: 700; }
.bn-detail-stage .bn-d-sub { font-size: .92rem; color: #8c7f9f; margin: 4px 0 14px; }
.bn-detail-stage img { width: 100%; max-width: 300px; border-radius: 12px; box-shadow: 0 10px 26px rgba(106, 90, 138, .16); }
.badge.home-flag { background: #efe7f7; color: #6a4f95; }
.sec-note { font-weight: 400; color: #9c9483; font-size: .78rem; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.eff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.eff-cell { background: #faf6ee; border: 1px solid #efe6d3; border-radius: 12px; padding: 12px 14px; }
.eff-cell .n { font-size: 1.4rem; font-weight: 800; color: var(--dark-purple); line-height: 1.1; }
.eff-cell .l { font-size: .76rem; color: #9c9483; margin-top: 3px; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ap-chip { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #ece6da; border-radius: 999px; padding: 6px 13px; font-size: .9rem; color: var(--dark-purple); }
/* 促銷卡：優惠重點 */
.pr-reward { color: var(--accent-gold); font-weight: 800; font-size: 1.05rem; margin: 4px 0 2px; }
