/* ===== 冠興新手機端 UI 主題 ===== */
/* 毛玻璃半透明 + 清新漸變 + 微立體效果 */

:root {
  --primary: #4F8CF7;
  --primary-dark: #3B6FD4;
  --primary-light: #7DADFF;
  --accent: #F76B8A;
  --accent-dark: #E05572;
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  --bg: #F0F4FB;
  --bg-card: rgba(255,255,255,0.72);
  --bg-glass: rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.6);
  --text-primary: #1C2333;
  --text-secondary: #5E6D82;
  --text-tertiary: #8E9CB2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-btn: 0 4px 14px rgba(79,140,247,0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --nav-height: 64px;
  --header-height: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(160deg, #e3edfb 0%, #eef3fc 50%, #e8f0fe 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: 
    radial-gradient(ellipse at 30% 30%, rgba(79,140,247,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(100,160,240,0.05) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; outline: none; }

/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0; z-index: 100;
  /* ★ 2026-09-30：改用三欄 grid（1fr auto 1fr），左右兩欄寬度恆等，
     標題欄（auto）才能相對「整條 header」真正居中。
     原 flex + space-between 會因左側「返回」膠囊（含文字約 90px）遠寬於
     右側 34px 佔位，令標題整體右偏約 28px（查詢PLU／新增採購單／調撥申請等均受影響）。 */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  /* ★ 2026-09-10：頂部「返回 / 新增」按鈕更靠近螢幕兩側
     原 padding: 0 16px → 左右各 6px；用 env() 相容橫向劉海／圓角安全區，避免貼邊被遮擋 */
  padding-left: calc(6px + env(safe-area-inset-left, 0px));
  padding-right: calc(6px + env(safe-area-inset-right, 0px));
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  box-shadow: var(--shadow-sm);
}
/* 三欄 grid 定位：左欄＝返回鈕靠左；右欄＝新增鈕／34px 佔位靠右；中欄＝標題 */
.app-header > .back-btn { justify-self: start; }
.app-header > :last-child:not(.back-btn):not(.title) { justify-self: end; }
.app-header .title {
  font-size: 1.1rem; font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}
.app-header .back-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  font-size: 1.2rem; color: var(--text-primary);
  transition: all 0.2s;
}
.app-header .back-btn:active { background: rgba(0,0,0,0.1); transform: scale(0.94); }
.app-header .action-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem; color: var(--primary);
  background: rgba(79,140,247,0.1);
  transition: all 0.2s;
}
.app-header .action-btn:active { background: rgba(79,140,247,0.2); transform: scale(0.94); }
/* ★ 2026-08-13：統一所有手機端頁面頂部導航按鈕 = 毛玻璃膠囊 + 文字標籤
   已含顯式 header-btn-text 的頁面（如採購列表）用 :has() 排除，避免文字重複 */
.app-header .back-btn,
.app-header .action-btn {
  width: auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 0.9rem;
  color: var(--text-primary);
}
/* 返回按鈕文字（無顯式文字時自動加） */
.app-header .back-btn:not(:has(.header-btn-text))::after {
  content: '返回';
  font-weight: 500;
  margin-left: 4px;
  white-space: nowrap;
}
/* 新增按鈕文字：加號圖標 → 「新增」，首頁圖標 → 「首頁」 */
.app-header .action-btn:not(:has(.header-btn-text))::after {
  content: '新增';
  font-weight: 500;
  margin-left: 4px;
  white-space: nowrap;
}
.app-header .action-btn:has(.ico-home):not(:has(.header-btn-text))::after { content: '首頁'; }
/* 統一圖標與文字深色 */
.app-header .back-btn .ico-back::after,
.app-header .action-btn .ico-add::after,
.app-header .action-btn .ico-home::after { stroke: #1F2937; }

/* ===== Main Content ===== */
.app-content {
  padding: 12px 6px;
  padding-bottom: calc(var(--nav-height) + 20px + var(--safe-bottom));
  min-height: calc(100vh - var(--header-height));
}
.app-content.no-nav {
  padding-bottom: calc(20px + var(--safe-bottom));
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-height);
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-top: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.68rem; color: var(--text-tertiary); gap: 3px;
  transition: all 0.25s;
  position: relative;
}
.nav-item .nav-icon { font-size: 1.35rem; line-height: 1; transition: transform 0.25s; }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon { transform: translateY(-2px); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}
.nav-item:active { opacity: 0.7; }

/* ===== Glass Card ===== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s;
}
.glass-card:active { transform: scale(0.985); box-shadow: var(--shadow-sm); }
.glass-card.compact { padding: 4px 14px; border-radius: var(--radius-md); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.01em;
  overflow: visible;
  transition: all 0.25s; position: relative;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  pointer-events: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; box-shadow: var(--shadow-btn);
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(79,140,247,0.3); }
.btn-glass-primary {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #4f8cf7 0%, #1d4ed8 100%);
  color: #fff; border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 18px rgba(79,140,247,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}
.btn-glass-primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 50%);
  pointer-events: none;
}
.btn-glass-primary:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(79,140,247,0.3), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-glass-primary svg { position: relative; z-index: 1; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(247,107,138,0.35);
}
.btn-accent:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(247,107,138,0.3); }
.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #28a745 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(52,199,89,0.35);
}
.btn-outline {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.08);
  color: var(--text-primary);
}
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: var(--bg-glass); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

/* ===== Badge / Tag ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
  backdrop-filter: blur(8px);
}
.badge-primary { background: rgba(79,140,247,0.12); color: var(--primary); }
.badge-success { background: rgba(52,199,89,0.12); color: var(--success); }
.badge-warning { background: rgba(255,149,0,0.12); color: var(--warning); }
.badge-danger  { background: rgba(255,59,48,0.12); color: var(--danger); }
.badge-info    { background: rgba(100,149,237,0.1); color: #5A8DEE; }
.badge-complete { background: rgba(56,158,13,0.12); color: #389e0d; }
.badge-cancel  { background: rgba(207,19,34,0.1); color: #cf1322; }

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.form-input, .form-select {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-md);
  font-size: 0.95rem; color: var(--text-primary);
  transition: all 0.25s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,140,247,0.12);
  background: rgba(255,255,255,0.75);
}

/* ===== Empty State ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state .empty-text { color: var(--text-tertiary); font-size: 0.92rem; }

/* ===== Loading ===== */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(4px);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.loading-overlay.active { display: flex; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(79,140,247,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast-container {
  position: fixed; top: calc(var(--header-height) + 8px); left: 50%;
  transform: translateX(-50%); z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px; border-radius: var(--radius-md);
  background: rgba(30,35,50,0.88); backdrop-filter: blur(12px);
  color: #fff; font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s ease-out;
  pointer-events: auto;
}
.toast.success { background: rgba(52,199,89,0.88); }
.toast.error { background: rgba(255,59,48,0.88); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Pagination ===== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 0;
}
.pagination .page-btn {
  width: 36px; min-width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600;
  background: var(--bg-glass); backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all 0.2s;
}
.pagination .page-btn.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,140,247,0.3);
}
.pagination .page-btn:active { transform: scale(0.92); }
.pagination .page-info { font-size: 0.8rem; color: var(--text-tertiary); }

/* ===== Pull-to-refresh hint ===== */
.pull-hint {
  text-align: center; padding: 8px; font-size: 0.75rem;
  color: var(--text-tertiary); display: none;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.modal-overlay.active { display: flex; }
.modal-dialog {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px; width: 90%; max-width: 360px;
  animation: modalIn 0.3s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-dialog .modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.modal-dialog .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-dialog .modal-actions button { flex: 1; }

/* ===== Switch ===== */
.switch-track {
  width: 48px; height: 28px; border-radius: 14px;
  background: rgba(0,0,0,0.1);
  position: relative; transition: all 0.3s;
  cursor: pointer;
}
.switch-track.active { background: var(--primary); }
.switch-track .switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.3s;
}
.switch-track.active .switch-thumb { left: 22px; }

/* ===== Order Card ===== */
.order-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: all 0.25s;
}
.order-card:active { transform: scale(0.985); }
.order-card .card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.order-card .card-sn { font-size: 0.83rem; font-weight: 700; color: var(--primary); letter-spacing: 0.01em; }
/* 列表卡片序號（純文字 序號. ） */
.order-card .card-seq { color: var(--primary); font-size: 0.8rem; font-weight: 700; margin-right: 6px; flex-shrink: 0; }
.order-card .card-status { display: flex; gap: 6px; }
.order-card .card-body { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; }
.order-card .card-row { display: flex; justify-content: space-between; color: var(--text-secondary); }
.order-card .card-row span:last-child { color: var(--text-primary); font-weight: 500; }
.order-card .card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

/* ===== Fixed Bottom Bar ===== */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 0; }

/* ===== 門店標籤（基礎樣式） ===== */
.shop-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px;
  font-size: 0.76rem; font-weight: 500; line-height: 1.4;
  border: none;
  background: rgba(0,0,0,0.02);
}

/* ===== 門店標籤顏色（kh_shop_name_webstyle） ===== */
/* shop_style 存的是 class 名（如 shop-style-01），移動端需在此定義才能上色 */
.shop-style-01 { color: #f5222d; border-color: #f5222d; background: rgba(245,34,45,0.08); font-weight: 600; }
.shop-style-02 { color: #fa8c16; border-color: #fa8c16; background: rgba(250,140,22,0.08); font-weight: 600; }
.shop-style-03 { color: #d4b106; border-color: #d4b106; background: rgba(212,177,6,0.08); font-weight: 600; }
.shop-style-04 { color: #52c41a; border-color: #52c41a; background: rgba(82,196,26,0.08); font-weight: 600; }
.shop-style-05 { color: #1890ff; border-color: #1890ff; background: rgba(24,144,255,0.08); font-weight: 600; }
.shop-style-06 { color: #722ed1; border-color: #722ed1; background: rgba(114,46,209,0.08); font-weight: 600; }
.shop-style-07 { color: #eb2f96; border-color: #eb2f96; background: rgba(235,47,150,0.08); font-weight: 600; }

/* ===== 彩色玻璃圖標（Heroicons 風格：黑描邊 + 大面積彩色填充） ===== */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  width: 26px; height: 26px; border-radius: 10px; flex-shrink: 0;
  vertical-align: middle; margin-right: 4px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(215,225,240,0.7) 50%, rgba(190,205,225,0.55) 100%);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.1),
    inset 0 1px 2px rgba(255,255,255,0.8),
    inset 0 -2px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}
/* 玻璃反光層（蓋在圖標之上） */
.ico::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.1) 70%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  z-index: 3;
}
.ico::after {
  content: ''; display: block;
  position: relative; z-index: 2;
  width: 18px; height: 18px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
}

/* 👤 創建人：黃底人形 */
.ico-creator::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='5' fill='%23FEF08A'/%3E%3Cpath d='M4 22c0-4 4-7 8-7s8 3 8 7'/%3E%3C/svg%3E"); }

/* 📅 日期：綠底日曆 */
.ico-date::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' fill='%2386EFAC'/%3E%3Cpath d='M3 10h18M8 2v4M16 2v4'/%3E%3C/svg%3E"); }

/* 🏪 店鋪：橙底屋 */
.ico-shop::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z' fill='%23FDBA74'/%3E%3Cpath d='M9 22V12h6v10'/%3E%3C/svg%3E"); }

/* 📦 數量：藍底盒 */
.ico-qty::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z' fill='%2393C5FD'/%3E%3Cpath d='M3.27 6.96L12 12.01l8.73-5.05'/%3E%3Cpath d='M12 22.08V12'/%3E%3C/svg%3E"); }

/* ✅ 實到：紫圓白勾 */
.ico-arrival::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23D8B4FE'/%3E%3Cpath d='M8 12l3 3 5-6' stroke='%239333EA' stroke-width='3'/%3E%3C/svg%3E"); }

/* ▶ 調入：綠圓右箭 */
.ico-in::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2386EFAC'/%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E"); }

/* ◀ 調出：紅圓左箭 */
.ico-out::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23FCA5A5'/%3E%3Cpath d='M19 12H5M12 5l-7 7 7 7'/%3E%3C/svg%3E"); }

/* 底部導航圖標 */
.ico-home::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12l9-9 9 9'/%3E%3Cpath d='M5 10v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V10' fill='%2386EFAC'/%3E%3Cpath d='M9 22V12h6v10'/%3E%3C/svg%3E"); }
.ico-purchase::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z' fill='%2393C5FD'/%3E%3Cpath d='M3.27 6.96L12 12.01l8.73-5.05'/%3E%3Cpath d='M12 22.08V12'/%3E%3C/svg%3E"); }
.ico-transfer::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3l4 4-4 4'/%3E%3Cpath d='M7 21l-4-4 4-4'/%3E%3Cpath d='M21 7H7a4 4 0 0 0-4 4v2' fill='%23FEF08A'/%3E%3Cpath d='M3 17h14a4 4 0 0 0 4-4v-2'/%3E%3C/svg%3E"); }
.ico-profile::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='5' fill='%23C4B5FD'/%3E%3Cpath d='M4 22c0-4 4-7 8-7s8 3 8 7'/%3E%3C/svg%3E"); }
.ico-user::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='5' fill='%2393C5FD'/%3E%3Cpath d='M4 22c0-4 4-7 8-7s8 3 8 7'/%3E%3C/svg%3E"); }
.ico-group::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='4' fill='%23C4B5FD'/%3E%3Cpath d='M2 21c0-4 3-6 7-6'/%3E%3Ccircle cx='17' cy='11' r='3.5' fill='%23FEF08A'/%3E%3Cpath d='M13.5 21c0-3 2-5 5.5-5'/%3E%3C/svg%3E"); }
.ico-clock::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9' fill='%23FEF08A'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }

/* 信息卡片內的圖標：去掉玻璃背景，保持簡潔 */
.info-row .ico, .action-row .ico { width: 22px; height: 22px; border-radius: 8px; background: transparent; border: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; margin-right: 0; }
.info-row .ico::after, .action-row .ico::after { width: 16px; height: 16px; }
.ico-camera::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2L7.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-3.17L15 2H9z' fill='%2393C5FD'/%3E%3Ccircle cx='12' cy='13' r='4' fill='%23FFFFFF'/%3E%3C/svg%3E"); }
.ico-reset::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7' fill='%23FDBA74'/%3E%3Cpath d='M3 4v5h5'/%3E%3C/svg%3E"); }

/* 底部導航中的圖標更大一號 */
.bottom-nav .ico { width: 28px; height: 28px; margin-right: 0; }
.bottom-nav .ico::after { width: 20px; height: 20px; }

/* 搜索圖標 */
.ico-search { background: transparent; border: none; box-shadow: none; margin-right: 0; }
.ico-search::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E9CB2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8' fill='%2393C5FD'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E"); }

/* 常用功能大圖標 */
.menu-card .menu-icon { width: 60px; height: 60px; background: transparent; }
.menu-card .ico { width: 48px; height: 48px; margin-right: 0; border-radius: 12px; }
.menu-card .ico::after { width: 32px; height: 32px; }

/* 首頁角標（紅色圓 + 白色數字） */
.notify-dot {
  display: none;
  align-items: center; justify-content: center;
  position: absolute; top: -8px; right: -8px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff; background: #FF3B30;
  box-shadow: 0 1px 3px rgba(255,59,48,0.35);
  pointer-events: none; white-space: nowrap;
  z-index: 11;
}
.notify-dot.show { display: flex; }

/* 庫存圖標 */
.ico-stock::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V7l4-4h6l4 4v14' fill='%2367E8F9'/%3E%3Cpath d='M9 21v-4h6v4' fill='%2322D3EE'/%3E%3C/svg%3E"); }

/* 銷售圖標 */
.ico-sales::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2h16a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z' fill='%2386EFAC'/%3E%3Cpath d='M8 2v20'/%3E%3Cpath d='M12 8h4'/%3E%3Cpath d='M12 12h4'/%3E%3Cpath d='M12 16h2'/%3E%3C/svg%3E"); }

/* 排班管理圖標 */
.ico-shift::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' fill='%23FDE68A'/%3E%3Cpath d='M3 10h18M8 2v4M16 2v4'/%3E%3Cpath d='M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01'/%3E%3C/svg%3E"); }

/* 刪除圖標 */
.ico-delete { background: transparent; border: none; box-shadow: none; margin-right: 0; cursor: pointer; }
.ico-delete::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23FCA5A5'/%3E%3Cpath d='M15 9l-6 6M9 9l6 6'/%3E%3C/svg%3E"); }

/* 列表卡片右上角紅點 */
.order-card { position: relative; }
.order-card .card-dot {
  position: absolute; top: 2px; right: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #FF3B30; box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
  z-index: 10;
}

/* 分頁箭頭 */
.ico-prev, .ico-next { background: transparent !important; border: none !important; box-shadow: none !important; margin-right: 0; }
.ico-prev::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E"); }
.ico-next::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E"); }

/* 頂部按鈕圖標 */
/* ← 返回：藍圓左箭頭 */
.ico-back { background: transparent; border: none; box-shadow: none; margin-right: 0; }
.ico-back::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2393C5FD'/%3E%3Cpath d='M14 17l-5-5 5-5'/%3E%3C/svg%3E"); }
/* ＋ 新增：綠圓加號 */
.ico-add { background: transparent; border: none; box-shadow: none; margin-right: 0; }
.ico-add::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F2937' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2386EFAC'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E"); }

/* 頂部欄中的圖標稍大（去裁剪，避免 SVG 四角被圓角矩形裁掉） */
.app-header .ico {
  width: 30px; height: 30px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  margin-right: 0;
}
.app-header .ico::before { display: none; }
.app-header .ico::after { width: 26px; height: 26px; }
/* 頂部欄左右按鈕：圖標 + 文字 同一行，統一毛玻璃背景 + 深色文字 */
.app-header .header-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto; height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.app-header .header-btn-text {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-primary);
}
/* 圖標描邊統一深色 */
.app-header .back-btn .header-btn-text,
.app-header .action-btn .header-btn-text { color: var(--text-primary); }
.app-header .ico-back::after,
.app-header .ico-add::after { stroke: #1F2937; }

/* ===== 通用確認彈窗 ===== */
.confirm-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45); z-index: 2100; display: none;
  justify-content: center; align-items: center; padding: 24px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.confirm-overlay.active { display: flex; }
.confirm-panel {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px; width: 100%; max-width: 310px;
  overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.confirm-body { padding: 22px 20px; text-align: center; font-size: 0.92rem; color: var(--text-primary); line-height: 1.65; white-space: pre-line; }
.confirm-foot { display: flex; border-top: 1px solid rgba(0,0,0,0.06); }
.confirm-foot button {
  flex: 1; border: none; padding: 14px; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s; background: transparent;
}
.confirm-foot .cfm-cancel { color: var(--text-secondary); }
.confirm-foot .cfm-ok { color: var(--accent); border-left: 1px solid rgba(0,0,0,0.06); }
.confirm-foot button:active { opacity: 0.5; }
