/* =============================================
   好購團 - 團購平台 CSS
   ============================================= */

/* ---------- Variables ---------- */
:root {
  --primary: #C24A1D;
  --primary-dark: #9F3B14;
  --primary-light: #fff0eb;
  --secondary: #2C3E50;
  --success: #27AE60;
  --warning: #F39C12;
  --danger: #E74C3C;
  --info: #3498DB;
  --bg: #F5F5F7;
  --bg-light: #F5F5F7;
  --bg-white: #FFFFFF;
  --border: #E8E8E8;
  --text: #1A1A1A;
  --text-muted: #666;
  --text-light: #777;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --header-h: 60px;
  --bottom-nav-h: 64px;
  --transition: all 0.2s ease;
}

/* ---------- Reduce-motion ---------- */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ---------- Splash Screen ---------- */
#app-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--primary, #e85a0e);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#app-splash.splash-hide {
  opacity: 0;
  pointer-events: none;
}
#app-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: splashPop 0.6s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes splashPop {
  from { opacity:0; transform:scale(0.7); }
  to   { opacity:1; transform:scale(1); }
}
#app-splash-dots {
  margin-top: 28px;
  display: flex;
  gap: 8px;
}
#app-splash-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  animation: splashDot 1.2s ease-in-out infinite;
}
#app-splash-dots span:nth-child(2) { animation-delay: 0.2s; }
#app-splash-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes splashDot {
  0%,80%,100% { transform:scale(0.6); opacity:0.4; }
  40%         { transform:scale(1);   opacity:1; }
}
body.reduce-motion #app-splash { transition: none; }
body.reduce-motion #app-splash-inner { animation: none; }
body.reduce-motion #app-splash-dots span { animation: none; }

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
a { cursor: pointer; text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
ul { list-style: none; }
hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ---------- App Layout ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-white);
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.12);
}

/* ---------- Header ---------- */
#main-header {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--header-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-left, .header-right {
  display: flex; align-items: center; gap: 8px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 700; color: var(--primary);
  cursor: pointer;
}
.logo i { font-size: 22px; }

/* ---------- Icon Button ---------- */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--secondary);
  transition: var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--bg); }

/* ---------- Badge ---------- */
.badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 17px; height: 17px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  font-weight: 700;
}

/* ---------- Avatar ---------- */
.avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
}
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.avatar.xl { width: 64px; height: 64px; font-size: 24px; }

/* ---------- User Dropdown ---------- */
.user-dropdown {
  position: absolute;
  top: var(--header-h);
  right: 0;
  width: 220px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  padding: 8px 0;
}
.user-dropdown .dropdown-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.user-dropdown a {
  display: flex; align-items: center;
  padding: 10px 16px;
  font-size: 14px;
  transition: var(--transition);
}
.user-dropdown a:hover { background: var(--bg); }
.user-dropdown a.text-danger { color: var(--danger); }

/* ---------- Sidebar ---------- */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  display: none;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }
.sidebar {
  position: fixed;
  left: -280px;
  top: 0; bottom: 0;
  width: 280px;
  background: var(--bg-white);
  z-index: 200;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transition: left 0.3s ease;
}
.sidebar.open { left: 0; }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  padding: 8px 20px 4px;
  letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item i { width: 18px; text-align: center; }
.nav-badge {
  background: var(--danger); color: #fff;
  font-size: 11px; padding: 2px 6px;
  border-radius: 10px; font-weight: 700;
  margin-left: auto;
}
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}

/* ---------- Main Content ---------- */
#main-content {
  padding-top: var(--header-h);
  padding-bottom: var(--bottom-nav-h);
  min-height: 100vh;
}

/* ---------- Pages ---------- */
.page { display: none; }
.page.active { display: block; }

/* ---------- Page Header ---------- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
}
.page-header h2 {
  font-size: 20px; font-weight: 700;
}

/* ---------- Banner ---------- */
.banner {
  background: linear-gradient(135deg, var(--primary) 0%, #ff4e00 100%);
  color: #fff;
  padding: 32px 20px 40px;
  position: relative;
  overflow: hidden;
}
.banner-content { position: relative; z-index: 1; }
.banner-tag {
  background: rgba(255,255,255,0.2);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  margin-bottom: 12px;
}
.banner h1 { font-size: 28px; font-weight: 900; line-height: 1.3; margin-bottom: 10px; }
.banner p { font-size: 14px; opacity: 0.9; margin-bottom: 20px; }
.banner-decor { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.banner-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.banner-circle.c1 { width: 150px; height: 150px; top: -30px; right: -30px; }
.banner-circle.c2 { width: 80px; height: 80px; top: 60px; right: 60px; }
.banner-circle.c3 { width: 120px; height: 120px; bottom: -40px; right: 20px; }

/* ---------- Section ---------- */
.section { padding: 20px 16px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 12px;
}

/* ---------- Category Grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.category-chip {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}
.category-chip:hover, .category-chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.category-chip .icon { font-size: 22px; margin-bottom: 4px; }
.category-chip .label { font-size: 11px; font-weight: 600; }

/* ---------- Product Grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-img {
  width: 100%; aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
}
.product-img-placeholder {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.product-info { padding: 10px; }
.product-name {
  font-size: 13px; font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.product-price-row {
  display: flex; align-items: center; gap: 6px;
}
.product-price { font-size: 15px; font-weight: 700; color: var(--primary); }
.product-original-price {
  font-size: 12px; color: var(--text-muted);
  text-decoration: line-through;
}
.product-tag-row { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.product-tag {
  font-size: 10px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}
.product-status-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.status-active { background: #e8f8f0; color: var(--success); }
.status-closed { background: #f5f5f5; color: var(--text-muted); }
.status-soldout { background: #fef0ef; color: var(--danger); }
.deadline-chip {
  font-size: 10px; color: var(--warning);
  background: #fff8e7;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex; align-items: center; gap: 3px;
}

/* ---------- Product Detail ---------- */
.product-detail-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  background: #fff;
}
.product-detail-body { padding: 16px; }
.product-detail-name {
  font-size: clamp(18px, 4.6vw, 21px);
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.product-detail-price-row {
  display: flex; align-items: flex-end; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.product-detail-price {
  font-size: clamp(24px, 6vw, 28px);
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}
.product-detail-original { font-size: 16px; color: var(--text-muted); text-decoration: line-through; }
.discount-badge {
  background: var(--danger); color: #fff;
  padding: 4px 8px; border-radius: 6px;
  font-size: 13px; font-weight: 700;
}
.product-info-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
}
.product-info-box .info-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
}
.product-info-box .info-row span:last-child { font-weight: 600; }
.product-desc {
  font-size: 13px; color: var(--text);
  line-height: 1.8; margin: 0;
}
.qty-control {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: fit-content;
}
.qty-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--primary);
  transition: var(--transition);
}
.qty-btn:hover { background: var(--primary-light); }
.qty-input {
  width: 48px; text-align: center;
  border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  height: 36px; font-size: 15px; font-weight: 600;
  outline: none;
}
.detail-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px;
}
.detail-actions .btn {
  min-width: 0;
  padding: 12px 10px;
}
.back-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 600; color: var(--secondary);
  cursor: pointer;
}
.back-btn:hover { color: var(--primary); }

@media (max-width: 390px) {
  .pd-qty-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .pd-price-result {
    align-items: flex-start;
  }
  .detail-actions,
  .pd-pickup-btns,
  .pd-spec-btns {
    grid-template-columns: 1fr;
  }
  .pd-share-btn {
    margin-left: 0;
  }
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  padding: 8px 16px 12px;
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.search-wrap {
  flex: 1; min-width: 180px;
  position: relative;
}
.search-wrap i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
}
.search-wrap input {
  width: 100%; padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  outline: none; font-size: 14px;
  transition: var(--transition);
}
.search-wrap input:focus { border-color: var(--primary); background: #fff; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  background: var(--bg);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Cart ---------- */
.cart-item {
  display: flex; align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cart-item-img {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { font-size: 15px; font-weight: 700; color: var(--primary); }
.cart-item-actions {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.remove-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--danger);
  background: #fef0ef;
  font-size: 12px;
  transition: var(--transition);
}
.remove-btn:hover { background: var(--danger); color: #fff; }
.cart-summary {
  padding: 16px;
  border-top: 2px solid var(--border);
  background: var(--bg);
}
.summary-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 14px;
}
.summary-row.total {
  font-size: 17px; font-weight: 700;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* ---------- Checkout ---------- */
.checkout-layout {
  padding: 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.payment-options {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.payment-option {
  flex: 1; min-width: 80px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px;
}
.payment-option input { display: none; }
.payment-option i { font-size: 22px; color: var(--text-muted); }
.payment-option.active, .payment-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.payment-option.active i, .payment-option:has(input:checked) i { color: var(--primary); }

/* ---------- Orders ---------- */
.order-filter-tabs {
  display: flex;
  overflow-x: auto;
  padding: 0 16px 8px;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.order-filter-tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  background: var(--bg);
  border: 1.5px solid var(--border);
  cursor: pointer; flex-shrink: 0;
  transition: var(--transition);
}
.tab.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
}
.order-card {
  margin: 0 16px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.order-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.order-no { font-size: 13px; font-weight: 700; color: var(--secondary); }
.order-date { font-size: 12px; color: var(--text-muted); }
.order-card-body { padding: 12px 14px; }
.order-item-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.order-item-img {
  width: 48px; height: 48px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
}
.order-item-info { flex: 1; font-size: 13px; }
.order-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.order-total { font-weight: 700; color: var(--primary); }

/* Order Status Badges */
.order-status {
  font-size: 12px; padding: 3px 10px;
  border-radius: 20px; font-weight: 600;
}
.os-pending { background: #fff8e7; color: var(--warning); }
.os-confirmed { background: #e8f4fd; color: var(--info); }
.os-shipping { background: #e8f8ff; color: #0099cc; }
.os-arrived { background: #e8f8f0; color: var(--success); }
.os-completed { background: #f0f0f0; color: var(--text-muted); }
.os-cancelled { background: #fef0ef; color: var(--danger); }

/* ---------- Notifications ---------- */
.notif-item {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
  position: relative;
}
.notif-item.unread { background: #fff8f5; }
.notif-item:hover { background: var(--bg); }
.notif-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-order_confirm { background: #e8f4fd; color: var(--info); }
.notif-shipping { background: #e8f8ff; color: #0099cc; }
.notif-arrived { background: #e8f8f0; color: var(--success); }
.notif-system { background: var(--bg); color: var(--text-muted); }
.notif-content .title { font-size: 14px; font-weight: 600; }
.notif-content .msg { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.notif-content .time { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.notif-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute; top: 16px; right: 14px;
}

/* ---------- Auth ---------- */
.auth-wrap {
  padding: 20px 16px;
  display: flex; justify-content: center;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center; margin-bottom: 20px;
}
.auth-logo i {
  font-size: 40px; color: var(--primary);
  display: block; margin-bottom: 8px;
}
.auth-logo h2 { font-size: 22px; font-weight: 900; color: var(--secondary); }
.auth-tabs {
  display: flex; background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: var(--transition);
  color: var(--text-muted);
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0; color: var(--text-muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ---------- Profile ---------- */
.profile-avatar-wrap {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 4px;
}
.max-w-md { max-width: 400px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---------- Order Success ---------- */
.success-wrap {
  text-align: center;
  padding: 48px 24px;
}
.success-icon {
  font-size: 72px; color: var(--success);
  margin-bottom: 20px;
}
.success-icon i { animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.success-wrap h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.order-no-display {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 18px; font-weight: 700; color: var(--primary);
  display: inline-block;
  letter-spacing: 2px;
}

/* ---------- Admin ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}
.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 10px;
}
.stat-value { font-size: 24px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 16px;
}
/* Admin Table */
.admin-table { width: 100%; overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-white);
}
.data-table th {
  background: var(--secondary);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg); }
.product-thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.sticky-card { position: sticky; top: calc(var(--header-h) + 12px); }
.card-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: 14px; color: var(--secondary);
}
.mb-3 { margin-bottom: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.my-3 { margin-top: 12px; margin-bottom: 12px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--secondary); margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; outline: none;
  transition: var(--transition);
  background: var(--bg-white);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,53,0.1); }
.form-control.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}
.field-error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
  line-height: 1.45;
}
.checkout-store-list.is-invalid {
  border: 1px solid rgba(231, 76, 60, 0.55);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: rgba(231, 76, 60, 0.04);
}
.form-row { display: flex; gap: 10px; }
.flex-1 { flex: 1; }
.input-icon-wrap { position: relative; }
.toggle-pw {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); cursor: pointer;
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: var(--transition);
  gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,107,53,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(255,107,53,0.45); transform: translateY(-1px); }
.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--secondary); background: transparent;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-white {
  background: #fff; color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.btn-white:hover { box-shadow: var(--shadow); }
.btn-text { color: var(--primary); font-weight: 600; font-size: 13px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.w-full { width: 100%; }

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--bottom-nav-h);
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  z-index: 100;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item i { font-size: 20px; }
.bnav-badge {
  position: absolute; top: 6px;
  left: 50%; margin-left: 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; font-weight: 700;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--secondary);
  color: #fff; padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px; text-align: center;
  pointer-events: none;
  white-space: pre-line;
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
  padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalIn 0.22s cubic-bezier(.34,1.3,.64,1) both;
}
.modal-box.large { max-height: 95vh; }
@keyframes modalIn {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
/* 向下相容舊動畫名稱 */
@keyframes slideUp {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-shrink: 0;
}

/* ---------- Loading ---------- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.8);
  z-index: 9998;
  display: flex; align-items: center; justify-content: center;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}

/* ---------- Deadline Banner ---------- */
.deadline-banner {
  background: linear-gradient(135deg, #C24A1D, #9F3B14);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.deadline-banner h3 { font-size: 16px; font-weight: 700; }
.deadline-banner p { font-size: 13px; opacity: 0.9; }

/* ---------- Utility ---------- */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.fw-bold { font-weight: 700; }
.fs-lg { font-size: 18px; }
.small { font-size: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-3 { gap: 12px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.error-msg {
  background: #fef0ef; color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border-left: 3px solid var(--danger);
}
.checkout-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; font-size: 13px;
}
.checkout-item-img {
  width: 40px; height: 40px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
}
.tag-badge {
  font-size: 11px; padding: 3px 8px;
  border-radius: 20px; font-weight: 600;
}
.tag-active { background: #e8f8f0; color: var(--success); }
.tag-closed { background: #f5f5f5; color: var(--text-muted); }
.tag-soldout { background: #fef0ef; color: var(--danger); }

/* Notify button for admin */
.btn-notify {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; font-size: 12px; padding: 4px 10px;
  border-radius: 6px;
}
.btn-notify:hover { opacity: 0.9; }
.notified-badge {
  background: #e8f8f0; color: var(--success);
  font-size: 11px; padding: 3px 8px;
  border-radius: 6px; font-weight: 600;
}

/* ===== Responsive ===== */
@media (min-width: 480px) {
  .sidebar {
    left: calc(50% - 240px - 280px);
  }
  .sidebar.open {
    left: calc(50% - 240px);
  }
}

/* =============================================
   新功能追加樣式
   ============================================= */

/* ---------- Quick Access ---------- */
.quick-access {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 0; padding: 0; border-top: 1px solid var(--border);
  background: var(--bg-white);
}
.qa-item {
  text-align: center; padding: 14px 6px;
  font-size: 11px; font-weight: 600; color: var(--secondary);
  cursor: pointer; transition: var(--transition);
  border-right: 1px solid var(--border);
}
.qa-item:last-child { border-right: none; }
.qa-item:hover { background: var(--primary-light); color: var(--primary); }
.qa-item .qa-icon { font-size: 22px; margin-bottom: 4px; }

/* ---------- Banner btn-white-outline ---------- */
.btn-white-outline {
  background: transparent; color: #fff;
  border: 2px solid rgba(255,255,255,0.7);
}
.btn-white-outline:hover { background: rgba(255,255,255,0.15); }

/* ---------- Cashback Mini ---------- */
.cashback-mini {
  font-size: 12px; color: var(--primary);
  font-weight: 600; margin-top: 2px;
}

/* ---------- Toggle Switch ---------- */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; background: #ccc;
  border-radius: 24px; cursor: pointer; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---------- Checkin Page ---------- */
.checkin-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 16px; text-align: center;
}
.checkin-hero h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.checkin-hero .big-num { font-size: 48px; font-weight: 900; line-height: 1; margin: 10px 0; }
.checkin-hero p { font-size: 13px; opacity: 0.85; }
.checkin-btn {
  width: 88px; height: 88px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 3px solid rgba(255,255,255,0.7);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 16px; cursor: pointer; transition: var(--transition);
}
.checkin-btn i { font-size: 24px; margin-bottom: 4px; }
.checkin-btn.done { background: rgba(255,255,255,0.5); cursor: default; }
.checkin-btn:not(.done):hover { background: rgba(255,255,255,0.4); transform: scale(1.05); }

/* =============================================
   UI/UX 改善 v2 — 2026年4月
   ============================================= */

/* ---- 頁面切換淡入動畫 ---- */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page.active { animation: pageIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ---- Skeleton Shimmer ---- */
@keyframes shimmer {
  0%   { background-position: -400% center; }
  100% { background-position:  400% center; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
}
.product-skeleton-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.product-skeleton-img  { width: 100%; aspect-ratio: 1; }
.product-skeleton-info { padding: 10px; }
.product-skeleton-title { height: 14px; margin-bottom: 7px; }
.product-skeleton-price { height: 16px; width: 55%; margin-bottom: 7px; }
.product-skeleton-tag   { height: 22px; width: 40%; border-radius: 12px; }

/* ---- Product Card: 已截止 / 已售完 視覺暗化 ---- */
.product-card[data-status="soldout"] .product-img,
.product-card[data-status="soldout"] .product-img-placeholder { filter: grayscale(65%) opacity(0.72); }
.product-card[data-status="closed"] .product-img,
.product-card[data-status="closed"] .product-img-placeholder  { filter: grayscale(40%) opacity(0.82); }
.product-card--soldout .product-soldout-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.product-card--soldout .product-soldout-text {
  color: #fff;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 6px;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 6px 14px;
}
.product-card--soldout .pinned-badge,
.product-card--soldout .special-tag-flash {
  z-index: 3;
}

/* ---- 底部導覽列 active 頂部指示線 + icon 提升 ---- */
.bottom-nav-item { transition: color 0.18s ease; }
.bottom-nav-item i { transition: transform 0.18s ease; }
.bottom-nav-item.active i { transform: translateY(-2px) scale(1.1); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* ---- Toast info 類型 ---- */
.toast.info { background: var(--info); }

/* ---- Button loading 狀態 ---- */
.btn.loading {
  opacity: 0.75;
  pointer-events: none;
  cursor: default;
}
.btn.loading .btn-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: rgba(255,255,255,0.9);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 5px; vertical-align: -2px;
  flex-shrink: 0;
}

/* ---- 排隊訂單卡片左欄色 ---- */
.oc2-card[data-status="queued"]::before { background: linear-gradient(180deg, #fb923c, #f97316); }
.oc2-card[data-status="pending"]::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }

/* ---- 商品卡片觸碰回饋 ---- */
.product-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.product-card:active { transform: scale(0.976) translateY(0) !important; box-shadow: none; }
.oc2-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.oc2-card:active { transform: scale(0.992) !important; box-shadow: 0 1px 6px rgba(0,0,0,0.07) !important; }

/* ---- 空白狀態輕量優化 ---- */
.empty-state .empty-emoji { font-size: 48px; margin-bottom: 10px; display: block; }
.empty-state p { font-size: 14px; }

/* ---- 訂單篩選 tab 可滑動提示（淡出遮蔽） ---- */
.order-filter-tabs { position: relative; }
.order-filter-tabs::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 8px;
  width: 28px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.92));
  pointer-events: none;
}

/* ---- 訂單 Hero 深色版 padding 調整 ---- */
.order-search-hero { padding: 20px 16px 18px; }
.order-search-hero .order-hero-stats-grid { margin-top: 10px; }

/* ---- 公告卡片動畫 ---- */
.announcement-card { animation: pageIn 0.3s ease both; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 5px; text-align: center;
}
.cal-header { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.cal-day {
  aspect-ratio: 1;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--bg);
}
.cal-day.checked { background: var(--primary); color: #fff; }
.cal-day.today { border: 2px solid var(--primary); color: var(--primary); background: var(--primary-light); }
.cal-day.today.checked { background: var(--primary); color: #fff; border-color: var(--primary-dark); }
.cal-day.empty { background: transparent; }
.reward-rules { display: flex; flex-direction: column; gap: 10px; }
.reward-rule {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.reward-rule.achieved { background: #e8f8f0; }
.reward-rule .rule-icon { font-size: 22px; }
.reward-rule .rule-info { flex: 1; font-size: 13px; }
.reward-rule .rule-reward { font-weight: 700; color: var(--primary); font-size: 15px; }
.progress-bar-wrap { background: var(--border); border-radius: 4px; height: 6px; margin-top: 6px; }
.progress-bar-fill { background: var(--primary); border-radius: 4px; height: 6px; transition: width 0.4s; }

/* ---------- Coupon Cards ---------- */
.coupon-card {
  display: flex; align-items: stretch;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.coupon-card.used, .coupon-card.expired { opacity: 0.55; }
.coupon-card.pending-use { border-left: 3px solid var(--warning); }
.coupon-left {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 84px; text-align: center;
  position: relative; flex-shrink: 0;
}
.coupon-left::after {
  content: '';
  position: absolute;
  right: -8px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: 3;
}
.coupon-value { font-size: 22px; font-weight: 900; line-height: 1; }
.coupon-unit { font-size: 11px; opacity: 0.9; margin-top: 2px; }
.coupon-right {
  flex: 1; padding: 12px 14px 12px 16px;
  border-left: 2px dashed var(--border);
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0;
}
.coupon-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.coupon-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.coupon-meta { font-size: 11px; color: var(--text-light); }
.coupon-meta span { margin-right: 8px; }
.coupon-code-badge {
  display: inline-block;
  background: var(--primary-light); color: var(--primary);
  padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  margin-top: 4px;
}
.coupon-expiry-warn {
  display: inline-block;
  background: #fff8e7; color: #d97706;
  border: 1px solid #fde68a;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 700; margin-top: 4px;
}
.coupon-pending-badge {
  display: inline-block;
  background: #fff8e7; color: var(--warning);
  border: 1px solid #fde68a;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  margin-top: 4px;
}
.claim-btn-area { display: flex; align-items: center; justify-content: flex-end; margin-top: 8px; gap: 6px; }
.stock-bar {
  background: var(--border); border-radius: 3px; height: 4px; margin-top: 6px;
}
.stock-fill { background: var(--primary); border-radius: 3px; height: 4px; }
.coupon-claimed-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--success); color: #fff;
  font-size: 10px; padding: 2px 7px; border-radius: 10px;
  font-weight: 700;
}
.coupon-used-stamp {
  position: absolute; top: 50%; right: 12px;
  transform: translateY(-50%) rotate(-15deg);
  border: 2px solid var(--text-muted); color: var(--text-muted);
  font-size: 13px; font-weight: 700; padding: 4px 10px;
  border-radius: 6px; opacity: 0.6;
}
/* Admin coupon card */
.admin-coupon-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.admin-coupon-card .ach-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.admin-coupon-card .ach-left { flex: 1; min-width: 0; }
.admin-coupon-card .ach-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.admin-coupon-card .ach-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.admin-coupon-card .ach-meta { font-size: 11px; color: var(--text-light); }
.admin-coupon-card .ach-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.admin-coupon-card .ach-bottom {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--border);
}

/* ---------- Admin Dashboard Recent Orders ---------- */
.admin-recent-order-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 5px rgba(0,0,0,.05);
}
.admin-recent-order-card:last-child { margin-bottom: 0; }
.admin-recent-order-card .aroc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.admin-recent-order-card .aroc-member {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.admin-recent-order-card .aroc-spec {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 7px;
}
.admin-recent-order-card .aroc-spec i {
  color: var(--primary);
  margin-top: 2px;
}
.admin-recent-order-card .aroc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}
.admin-recent-order-card .aroc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@keyframes adminRecentOrderSlideDown {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-recent-order-card.is-new {
  animation: adminRecentOrderSlideDown .36s cubic-bezier(.2,.9,.25,1) both;
}
/* Coupon use request card */
.cr-request-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.cr-request-card .cr-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.cr-request-card .cr-actions { display: flex; gap: 6px; margin-top: 8px; }


/* ---------- Checkout Coupon Area ---------- */
.coupon-input-row { display: flex; gap: 8px; }
.coupon-applied-box {
  display: flex; align-items: center; justify-content: space-between;
  background: #e8f8f0; border: 1px solid var(--success);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 8px;
  font-size: 14px; color: var(--success); font-weight: 600;
}
.cashback-use-row {
  display: flex; align-items: center; justify-content: space-between;
}
.my-coupon-mini {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 6px; cursor: pointer;
  transition: var(--transition); font-size: 13px;
}
.my-coupon-mini:hover { border-color: var(--primary); background: var(--primary-light); }
.my-coupon-mini.selected { border-color: var(--primary); background: var(--primary-light); }

/* ---------- Wallet Page ---------- */
.wallet-hero {
  background: linear-gradient(135deg, #f7971e, #ffd200);
  border-radius: var(--radius-lg); padding: 24px;
  text-align: center; margin-bottom: 16px; color: var(--secondary);
}
.wallet-hero .balance-big { font-size: 44px; font-weight: 900; }
.wallet-hero p { font-size: 13px; opacity: 0.7; margin-top: 4px; }
.cashback-record {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cashback-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.cb-add { background: #e8f8f0; color: var(--success); }
.cb-use { background: #fef0ef; color: var(--danger); }
.cb-admin { background: #e8f4fd; color: var(--info); }
.cashback-record .cb-title { font-size: 14px; font-weight: 600; }
.cashback-record .cb-date { font-size: 12px; color: var(--text-muted); }
.cashback-record .cb-amount { font-size: 15px; font-weight: 700; margin-left: auto; white-space: nowrap; }
.cb-amount.positive { color: var(--success); }
.cb-amount.negative { color: var(--danger); }

/* ---------- Store selection ---------- */
.store-option {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  margin-bottom: 8px; cursor: pointer; transition: var(--transition);
}
.store-option:hover { border-color: var(--primary); background: var(--primary-light); }
.store-option.selected { border-color: var(--primary); background: var(--primary-light); }
.store-option input[type=radio] { display: none; }
.store-option .store-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.store-option .store-addr { font-size: 12px; color: var(--text-muted); }
.store-option .store-hours { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.store-info-box {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13px; margin-top: 10px;
}
.store-success-box {
  background: #e8f8f0; border: 1px solid var(--success);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 14px; margin: 12px auto; max-width: 320px; text-align: left;
}
.store-success-box .sn { font-weight: 700; font-size: 15px; margin-bottom: 4px; }

/* ---------- Admin Coupon Table ---------- */
.coupon-row-type {
  font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 700;
}
.ctype-fixed { background: #fff0eb; color: var(--primary); }
.ctype-percent { background: #e8f0fe; color: #4a6cf7; }

/* ---------- Store Cards (Admin) ---------- */
.store-admin-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.store-admin-card .store-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.store-admin-card .store-title { font-size: 16px; font-weight: 700; }
.store-admin-card .store-detail { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ---------- Admin Cashback Table ---------- */
.member-cashback-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.member-cashback-row .m-info { flex: 1; }
.member-cashback-row .m-name { font-size: 14px; font-weight: 600; }
.member-cashback-row .m-email { font-size: 12px; color: var(--text-muted); }
.member-cashback-row .m-balance { font-size: 18px; font-weight: 800; color: var(--warning); margin-right: 8px; }

/* ---------- Role Tags ---------- */
.role-tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.3px;
}
.role-admin  { background: #ffecd2; color: #9F3B14; }
.role-hq     { background: #e8f4fd; color: #2980b9; }
.role-staff_hq { background: #e8f4fd; color: #2980b9; }
.role-store  { background: #e8f8f0; color: #27ae60; }
.role-staff_store { background: #e8f8f0; color: #27ae60; }
.role-member { background: #f5f5f7; color: #666; }

.role-legend { padding: 16px; }
.role-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.role-row:last-child { border-bottom: none; }

/* ---------- Duty Chip ---------- */
.duty-chip {
  display: flex; align-items: center; gap: 4px;
  background: var(--primary); color: #fff;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Store Orders ---------- */
#store-order-tabs { display: flex; overflow-x: auto; gap: 4px; padding: 8px 12px; background: var(--bg-white); border-bottom: 1px solid var(--border); }
#store-order-tabs .tab { flex-shrink: 0; }

/* ---------- Notified Badge ---------- */
.notified-badge { background: #e8f8f0; color: var(--success); font-weight: 600; border-radius: 8px; padding: 8px; font-size: 13px; }

/* ---------- nav-section-title override ---------- */
.nav-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 8px 16px 4px; letter-spacing: 0.5px; }

/* ---------- Tag Badges Extended ---------- */
.tag-pending  { background: #fff8e7; color: var(--warning); border: 1px solid #ffe082; }
.tag-active   { background: #e8f8f0; color: var(--success); border: 1px solid #a5d6a7; }
.tag-danger   { background: #fdecea; color: var(--danger); border: 1px solid #ef9a9a; }
.tag-closed   { background: #f5f5f7; color: var(--text-muted); border: 1px solid var(--border); }
.tag-done     { background: #e8f4fd; color: var(--info); border: 1px solid #90caf9; }
.tag-badge    { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }

/* ---------- Announcement Cards ---------- */
.announcement-card {
  padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 8px; border-left: 4px solid;
}
.ann-normal  { background: #e8f4fd; border-color: var(--info); }
.ann-important { background: #fdecea; border-color: var(--danger); }
.ann-sale    { background: #fff8e7; border-color: var(--warning); }

/* ---------- Finance Stats ---------- */
.stats-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stat-mini  {
  flex: 1; min-width: 80px; background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 12px; text-align: center;
}
.stat-mini-val   { font-size: 18px; font-weight: 800; color: var(--primary); }
.stat-mini-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Revenue Analysis ---------- */
.revenue-analysis-page {
  background:
    radial-gradient(900px 340px at 0% -18%, rgba(15, 118, 110, 0.22), transparent 58%),
    radial-gradient(760px 300px at 100% -12%, rgba(8, 145, 178, 0.2), transparent 56%),
    var(--bg);
}

.revenue-analysis-shell { padding: 0 16px 22px; }

.revenue-analysis-intro {
  padding: 14px 14px 12px;
  margin-bottom: 14px;
  border: 1px solid #67e8f9;
  background: linear-gradient(135deg, #0f766e, #0e7490 58%, #0369a1);
  box-shadow: 0 14px 30px rgba(8, 145, 178, 0.22);
}

.revenue-analysis-intro-text {
  font-size: 13px;
  line-height: 1.72;
  color: #ecfeff;
  font-weight: 600;
}

.revenue-analysis-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.revenue-analysis-month-row,
.revenue-analysis-store-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.revenue-analysis-store-row {
  flex-wrap: wrap;
}

.revenue-analysis-month-row .btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.revenue-analysis-month-row .form-control,
.revenue-analysis-store-row .form-control {
  margin-bottom: 0;
}

.revenue-analysis-month-row .form-control { flex: 1; }

.revenue-analysis-store-row .form-control {
  flex: 1;
  min-width: 160px;
}

.revenue-analysis-store-row .btn {
  width: 100%;
}

.revenue-analysis-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ra-empty-state {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
}

.ra-empty-icon {
  font-size: 34px;
  opacity: 0.25;
  display: block;
  margin-bottom: 10px;
}

.ra-empty-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.ra-empty-desc { font-size: 13px; }

.ra-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ra-kpi-card {
  --ra-tone: #0f766e;
  --ra-bg: #f8fafc;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(145deg, var(--ra-bg), #ffffff 70%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09);
}

.ra-kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ra-tone);
}

.ra-kpi-tone-revenue { --ra-tone: #0f766e; --ra-bg: #ecfdf5; }
.ra-kpi-tone-quarter { --ra-tone: #7c3aed; --ra-bg: #f5f3ff; }
.ra-kpi-tone-daily { --ra-tone: #0369a1; --ra-bg: #ecfeff; }
.ra-kpi-tone-ticket { --ra-tone: #c2410c; --ra-bg: #fff7ed; }
.ra-kpi-tone-coverage { --ra-tone: #15803d; --ra-bg: #f0fdf4; }

.ra-kpi-head { margin-bottom: 6px; }

.ra-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ra-kpi-label i { color: var(--ra-tone); }

.ra-kpi-value {
  font-size: clamp(18px, 4.7vw, 24px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--ra-tone);
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.ra-kpi-delta {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
}

.ra-kpi-delta.is-up { color: var(--success); }
.ra-kpi-delta.is-down { color: var(--danger); }
.ra-kpi-delta.is-muted { color: var(--text-light); }

.ra-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ra-mini-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
}

.ra-mini-card:nth-child(1) {
  border-color: #a5f3fc;
  background: linear-gradient(145deg, #ecfeff, #ffffff);
}

.ra-mini-card:nth-child(2) {
  border-color: #ddd6fe;
  background: linear-gradient(145deg, #f5f3ff, #ffffff);
}

.ra-mini-card:nth-child(3) {
  border-color: #bbf7d0;
  background: linear-gradient(145deg, #f0fdf4, #ffffff);
  grid-column: 1 / -1;
}

.ra-mini-label {
  font-size: 11px;
  color: #0f766e;
  font-weight: 700;
  margin-bottom: 4px;
}

.ra-mini-value {
  font-size: clamp(16px, 4.2vw, 20px);
  font-weight: 900;
  color: #115e59;
  overflow-wrap: anywhere;
}

.ra-payment-card {
  padding: 14px;
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border-color: #cbd5e1;
}

.ra-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ra-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ra-section-title i { color: #0369a1; }

.ra-section-meta {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.ra-payment-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 8px;
}

.ra-payment-segment { height: 100%; }
.ra-payment-segment.ra-cash { background: linear-gradient(90deg, #0ea5e9, #0284c7); }
.ra-payment-segment.ra-mobile { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }

.ra-payment-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.ra-payment-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.ra-payment-cash { color: #0369a1; }
.ra-payment-mobile { color: #7c3aed; }

.ra-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ra-chart-card { padding: 14px; }

.ra-chart-card-clickable {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.1);
  cursor: zoom-in;
  transition: box-shadow .18s ease, transform .18s ease;
}

.ra-chart-card-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.ra-chart-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  margin: -2px 0 8px;
}

#revenue-chart-zoom-overlay {
  z-index: 1200;
  padding: 14px;
}

.ra-zoom-modal {
  width: min(940px, 94vw) !important;
  max-width: min(940px, 94vw) !important;
  max-height: 92vh;
  border-radius: 18px !important;
}

.ra-zoom-modal::before { display: none !important; }

.ra-zoom-body {
  padding: 10px 16px 18px;
  overflow-y: auto;
}

.ra-zoom-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ra-zoom-chart-wrap {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.ra-zoom-chart-wrap svg {
  width: 100%;
  max-height: none !important;
}

.ra-chart-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ra-chart-title i { color: #0f766e; }

.ra-insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ra-insight-card {
  padding: 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
}

.ra-insight-store {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.ra-insight-day {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.ra-insight-ticket {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.ra-insight-eyebrow {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.ra-insight-main {
  font-size: clamp(17px, 4.2vw, 22px);
  font-weight: 900;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ra-insight-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
}

.ra-store-board {
  padding: 14px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
}

.ra-store-board-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ra-store-board-title i { color: #0f766e; }

.ra-store-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ra-store-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 13px;
  padding: 14px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.ra-store-card.is-top {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.ra-store-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.ra-store-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ra-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #0f766e;
  background: #dcfce7;
}

.ra-store-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ra-store-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.ra-store-revenue-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.ra-store-revenue {
  font-size: clamp(17px, 4.2vw, 22px);
  font-weight: 900;
  color: #0f766e;
  overflow-wrap: anywhere;
}

.ra-store-growth {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
  text-align: right;
  overflow-wrap: anywhere;
}

.ra-store-growth.is-up { color: var(--success); }
.ra-store-growth.is-down { color: var(--danger); }
.ra-store-growth.is-muted { color: var(--text-light); }

.ra-progress-row { margin-bottom: 10px; }

.ra-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 12px;
}

.ra-progress-label {
  color: var(--text-muted);
  font-weight: 700;
}

.ra-progress-value {
  color: #0f766e;
  font-weight: 800;
}

.ra-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.ra-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #0f766e);
}

.ra-store-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ra-store-metric {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
}

.ra-store-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ra-store-metric-value {
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 800;
  color: #0f172a;
  overflow-wrap: anywhere;
}

@media (min-width: 430px) {
  .revenue-analysis-store-row .btn { width: auto; }
}

@media (max-width: 520px) {
  .ra-kpi-grid { grid-template-columns: 1fr; }
  .ra-mini-grid { grid-template-columns: 1fr; }
  .ra-mini-card:nth-child(3) { grid-column: auto; }
  .ra-store-metrics { grid-template-columns: 1fr; }
  .ra-store-revenue-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .ra-store-growth { text-align: left; }

  .ra-zoom-modal {
    width: 96vw !important;
    max-width: 96vw !important;
  }

  .ra-zoom-body {
    padding: 8px 12px 14px;
  }
}

/* ---------- Admin Table ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { background: var(--bg); padding: 8px 10px; text-align: left; font-weight: 700; font-size: 12px; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg); }
.admin-table code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 12px; }

/* ---------- Inventory Item Row ---------- */
.inv-item-row:last-child { border-bottom: none; }

/* ---------- Return Status Colors ---------- */
.os-completed, .os-arrived { color: var(--success); }
.os-pending   { color: var(--warning); }
.os-cancelled, .os-abandoned { color: var(--text-muted); }
.os-abandoned_no_count { color: var(--text-muted); }
.os-uncollected { color: var(--danger); }
.os-queued    { color: var(--info); }
.os-group_closed { color: #4338ca; }

/* ---------- Wish Pool ---------- */
.wish-card { padding: 14px; background: var(--bg-white); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow-sm); }

/* ---------- Tab Group ---------- */
.tab-group { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.tab-group .tab { flex-shrink: 0; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--bg); color: var(--text-muted); border: none; }
.tab-group .tab.active { background: var(--primary); color: #fff; }

/* ---------- btn-success ---------- */
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; }

/* ---------- Member Level Badges ---------- */
.member-silver { color: #555; background: #f0f0f0; padding: 2px 8px; border-radius: 10px; border: 1px solid #c0c0c0; }
.member-gold   { color: #7a5c00; background: #ffd700; padding: 2px 8px; border-radius: 10px; }
.member-black  { color: #ffd700; background: #1a1a1a; padding: 2px 8px; border-radius: 10px; }

/* ---------- Profile Stats ---------- */
.profile-stat-row { display: flex; gap: 4px; margin: 12px 0; }
.profile-stat { flex: 1; text-align: center; padding: 10px 4px; background: var(--bg); border-radius: var(--radius-sm); }

/* ---------- Clickable Cards ---------- */
.clickable { cursor: pointer; transition: var(--transition); }
.clickable:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* ---------- Inventory Item Active ---------- */
.inv-item-row.has-qty { background: #fff8f0; }
.inv-item-row.has-qty input { border-color: var(--primary); font-weight: 700; }

/* ---------- Data Table (full-width) ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: var(--bg); padding: 8px 10px; text-align: left; font-weight: 700; font-size: 12px; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: #fafafa; }

/* ---------- Order Status Full Labels ---------- */
.os-partial { color: var(--info); }

/* ---------- Opacity utility ---------- */
.opacity-60 { opacity: 0.6; }

/* ---------- Duty Store Quick Actions ---------- */
#duty-store-selected-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }

/* ---------- Tag Soldout ---------- */
.tag-soldout { background: #fde8e8; color: var(--danger); border: 1px solid #ef9a9a; }

/* ---------- Info Row in Product Box ---------- */
.info-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 8px; }
.info-row span:first-child { color: var(--text-muted); flex-shrink: 0; }
.info-row span:last-child { text-align: right; font-weight: 500; }
.info-row:last-child { border-bottom: none; }

/* ---------- Wish Pool Card states ---------- */
#wish-pool-list .card:hover { box-shadow: var(--shadow); }

/* ══════════════════════════════════════════════
   團購商品列表 (Product List)
══════════════════════════════════════════════ */
.product-list-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.pli-main { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.pli-thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; border: 1px solid var(--border); }
.pli-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pli-info { flex: 1; min-width: 0; }
.pli-name { font-weight: 700; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 4px; word-break: break-word; }
.pli-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.pli-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.pli-danger-divider {
  display: inline-block; width: 1px; height: 28px;
  background: #fca5a5; margin: 0 6px; align-self: center; flex-shrink: 0;
}
.pli-delete-btn { border-color: #fca5a5 !important; }
.pli-pin { color: #f59e0b; }
.tag-draft   { background: #fef3c7; color: #92400e; }
.tag-pickup  { background: #dbeafe; color: #1e40af; }
.tag-disabled { background: #fce7f3; color: #be185d; }
.special-tag-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--primary); color: #fff; white-space: nowrap; }

/* ── 規格編輯器 ── */
.spec-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.spec-row input { min-width: 0; }

/* ── 取貨日期 chips ── */
.chips-container { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; min-height: 38px; background: var(--bg); margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 14px; }
.chip button { background: none; border: none; color: #fff; cursor: pointer; padding: 0; font-size: 11px; line-height: 1; }

/* ── 表單分節標題 ── */
.form-section-title { font-size: 11px; font-weight: 700; color: var(--primary); padding: 6px 0 4px; border-bottom: 2px solid #e8f0fe; margin: 14px 0 10px; text-transform: uppercase; letter-spacing: .5px; }

/* ── 到貨狀況 store toggle ── */
.arrival-store-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.arrival-store-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--border); cursor: pointer; transition: all 0.2s; font-size: 13px; min-width: 80px; text-align: center; user-select: none; }
.arrival-store-item.arrived { border-color: var(--success); background: #f0fdf4; color: var(--success); }
.arrival-store-item.partial { border-color: #f59e0b; background: #fffbeb; color: #b45309; }
.arrival-store-item.arrival-disabled { cursor: not-allowed; opacity: 0.45; pointer-events: none; }
.arrival-store-item .store-icon { font-size: 20px; }
.arrival-store-item .store-meta { font-size: 10px; line-height: 1.35; color: inherit; opacity: .85; }

#page-admin-scan #scan-detail-view {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}
#page-admin-scan #scan-detail-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#page-admin-scan #scan-detail-action {
  position: sticky;
  bottom: 0;
  margin-top: auto;
}

/* ===== 開團商品編輯 Modal — Layout Refresh ===== */
#product-modal .pm-modal {
  max-width: 940px;
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

#product-modal .pm-modal::before {
  display: none;
}

#product-modal .pm-modal-body {
  padding: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.06) 0, rgba(37, 99, 235, 0) 42%),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
}

#product-modal .pm-top-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  padding: 10px 12px;
}

#product-modal .pm-top-hint i {
  margin-top: 2px;
}

#product-modal .pm-panel {
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

#product-modal .pm-panel .form-group:last-child {
  margin-bottom: 0;
}

#product-modal .form-section-title {
  margin: 0 0 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 0 0 8px;
}

#product-modal .launch-option-group {
  gap: 7px;
}

#product-modal .launch-option-btn {
  border-width: 1px;
  border-color: #dbe4f1;
  border-radius: 999px;
  font-weight: 700;
  padding: 7px 14px;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.05);
}

#product-modal .launch-option-btn.active {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: #15803d;
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.24);
}

#product-modal .launch-option-btn.cancel-btn {
  border-color: #ef4444;
  color: #b91c1c;
}

#product-modal .launch-option-btn.cancel-btn.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

#product-modal .pm-store-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid #dbe4f1;
  border-radius: 999px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

#product-modal .pm-store-chip:has(input:checked) {
  background: #ecfdf3;
  border-color: #86efac;
  color: #166534;
}

#product-modal .pm-store-chip input {
  accent-color: #16a34a;
}

#product-modal .group-card {
  border-color: #cfdced;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

#product-modal .group-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #dbe4f1;
}

#product-modal .group-card-head-meta {
  flex: 1;
  min-width: 0;
}

#product-modal .group-card-head-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

#product-modal .group-card-head-sub {
  font-size: 11px;
  color: #64748b;
}

#product-modal .group-card-body {
  display: block;
}

#product-modal .group-card.is-collapsed .group-card-body {
  display: none;
}

#product-modal .group-card.is-collapsed .group-card-head {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

#product-modal .cutoff-item {
  border-color: #cfdced;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

#product-modal .cutoff-head-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#product-modal .cutoff-head-sub {
  font-size: 11px;
  color: #64748b;
}

#product-modal .cutoff-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

#product-modal .cutoff-body {
  display: block;
}

#product-modal .cutoff-item.is-collapsed .cutoff-body {
  display: none;
}

#product-modal .cutoff-item.is-collapsed .cutoff-header {
  margin-bottom: 0;
}

#product-modal .pm-collapse-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

#product-modal .group-section-label {
  color: #2563eb;
}

#product-modal .pm-images-grid {
  gap: 10px;
}

#product-modal .pm-img-item {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

#product-modal .pm-modal-footer {
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
}

#product-modal .pm-modal-footer .btn {
  min-width: 110px;
}

@media (max-width: 760px) {
  #product-modal .pm-modal {
    max-width: 100%;
    border-radius: 18px;
  }

  #product-modal .pm-modal-body {
    padding: 10px;
  }

  #product-modal .pm-panel {
    padding: 10px;
  }
}

/* ── 管理訂單 changed card ── */
.mo-card-changed { border-left: 3px solid var(--primary) !important; background: #f0f9ff !important; }

/* ===== 商品 Modal v2 — 上架選項 / 標籤 / 圖片 / 群組 / 結單 ===== */
.launch-option-group { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:4px; }
.launch-option-btn { padding:7px 16px; border:2px solid var(--border); border-radius:8px; background:#fff; cursor:pointer; font-size:13px; font-weight:500; transition:all 0.15s; line-height:1.4; }
.launch-option-btn:hover { border-color:var(--primary); }
.launch-option-btn.active { border-color:var(--primary); background:var(--primary); color:#fff; }
.launch-option-btn.cancel-btn { border-color:#e53935; color:#e53935; }
.launch-option-btn.cancel-btn.active { background:#e53935; color:#fff; border-color:#e53935; }
.launch-option-btn.cancel-btn:hover { border-color:#c62828; }
.pm-tag-row { display:flex; gap:6px; align-items:center; }
.pm-images-grid { display:flex; flex-wrap:wrap; gap:8px; min-height:4px; }
.pm-img-item { position:relative; width:76px; height:76px; border:2px solid var(--border); border-radius:8px; overflow:hidden; background:#fff; flex-shrink:0; user-select:none; cursor:grab; }
.pm-img-item img { width:100%; height:100%; object-fit:contain; background:#fff; display:block; }
.pm-img-del { position:absolute; top:2px; right:2px; background:rgba(0,0,0,.55); color:#fff; border:none; border-radius:50%; width:20px; height:20px; cursor:pointer; font-size:11px; display:flex; align-items:center; justify-content:center; padding:0; z-index:2; }
.pm-img-arrows { position:absolute; bottom:0; left:0; right:0; display:flex; justify-content:space-between; background:rgba(0,0,0,.4); padding:2px 4px; }
.pm-img-arrows button { background:none; border:none; color:#fff; cursor:pointer; font-size:11px; padding:0 4px; line-height:1.5; }
.pm-img-arrows button:hover { color:#ffd; }
.pm-img-item.dragging { opacity:.45; border:2px dashed var(--primary); }
.group-card { border:1.5px solid var(--border); border-radius:10px; padding:14px; margin-bottom:12px; background:#fafcff; }
.group-header { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.group-name-input { flex:1; font-weight:600; }
.group-section-label { font-size:11px; font-weight:700; color:var(--text-muted); margin:10px 0 6px; text-transform:uppercase; letter-spacing:.5px; }
.tier-row { display:flex; gap:6px; align-items:center; margin-bottom:6px; }
.tier-avg-label { min-width:72px; font-size:11px; color:var(--primary); flex-shrink:0; }
.spec-item { border:1px solid #e0e4ec; border-radius:8px; padding:10px 12px; margin-bottom:8px; background:#fff; }
.spec-row-main { display:flex; gap:6px; align-items:center; margin-bottom:8px; }
.spec-options { display:flex; flex-wrap:wrap; gap:10px; }
.spec-opt-row { display:flex; align-items:center; gap:4px; font-size:12px; cursor:pointer; flex-shrink:0; }
.spec-opt-row input[type="number"].form-control { width:62px; padding:4px 6px; }
.cutoff-item { border:1px solid #e0e4ec; border-radius:8px; padding:12px; margin-bottom:8px; background:#fff; }
.cutoff-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
#pm-name-history-wrap { position:relative; flex:1; }
#pm-name-history-list { position:absolute; z-index:20; background:#fff; border:1px solid var(--border); border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.12); max-height:180px; overflow-y:auto; width:100%; top:100%; left:0; }
#pm-name-history-list .name-hist-item { padding:8px 12px; cursor:pointer; font-size:13px; border-bottom:1px solid #f0f0f0; }
#pm-name-history-list .name-hist-item:hover { background:#f5f8ff; }
.tag-cancelled { background:#fce4e4; color:#c62828; border-color:#e57373; }
.os-cancelled { background:#fce4e4; color:#c62828; }

/* ---------- Nav Category (Admin Collapsible) ---------- */
.nav-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  border-radius: 6px;
  transition: background 0.15s;
  user-select: none;
  margin-top: 4px;
}
.nav-category-header:hover { background: var(--bg-light); }
.nav-cat-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s;
  opacity: 0.7;
}
.nav-category-body { padding-bottom: 4px; }
.nav-item.nav-sub { padding-left: 24px; font-size: 14.5px; padding-top: 10px; padding-bottom: 10px; }
.nav-item.nav-sub i { width: 18px; text-align: center; font-size: 14px; }

/* 管理員側欄搜尋框 */
#admin-nav-search:focus {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ---------- Theme Swatches ---------- */
.theme-swatch {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active {
  border-color: #fff;
  outline: 2px solid #555;
  transform: scale(1.1);
}

/* ---------- Pickup Group Items ---------- */
.pickup-group-item input[type="checkbox"]:checked + div { opacity: 1; }
.pickup-group-item input[type="checkbox"]:not(:checked) + div { opacity: 0.45; }

/* ---------- Cache Key List ---------- */
#admin-cache-keys-list span[style*="monospace"] { font-size: 12px; }

/* ---------- Uncollected Two-Level ---------- */
.uncollected-product-row:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 2px 12px rgba(255,107,53,.12);
}
#uncollected-filter-bar { transition: opacity .2s; }

/* ---------- Order Status Spec Breakdown ---------- */
#admin-order-status-list .card { transition: box-shadow .15s; }
#admin-order-status-list .card:hover { box-shadow: var(--shadow); }

/* ---------- Admin Order Status (收單狀況) ---------- */
.admin-os-shell {
  padding: 0 16px 16px;
}

.admin-os-filter-bar {
  margin-bottom: 10px;
}

.admin-os-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.admin-os-tab {
  border: 1px solid #dbe4f1;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.admin-os-tab.active {
  color: #ffffff;
  border-color: #4338ca;
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.24);
}

.admin-os-tab-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  padding: 0 5px;
  background: #eef2ff;
  color: #4338ca;
}

.admin-os-tab.active .admin-os-tab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.admin-os-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-os-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-os-summary-card {
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
  padding: 10px;
}

.admin-os-summary-card .k {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.admin-os-summary-card .v {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
  margin-top: 2px;
}

.admin-os-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-os-card {
  border: 1px solid #dbe4f1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  padding: 12px;
}

.admin-os-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-os-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.admin-os-product-pill {
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.admin-os-product-pill.active {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.admin-os-product-pill.closed {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.admin-os-product-pill.pickup {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.admin-os-product-pill.soldout {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.admin-os-status-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-os-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  font-size: 13px;
}

.admin-os-total-text {
  color: #64748b;
}

.admin-os-total-text b {
  color: #0f172a;
}

.admin-os-total-text .c-closed {
  color: #4338ca;
}

.admin-os-total-text .c-queued {
  color: #7c3aed;
}

.admin-os-total-text .c-cancel {
  color: #dc2626;
}

.admin-os-total-num {
  font-size: 15px;
  font-weight: 900;
  color: var(--primary);
  white-space: nowrap;
}

.admin-os-spec-wrap {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf2f7;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-os-spec-chip {
  font-size: 11px;
  color: #64748b;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 999px;
  padding: 3px 8px;
}

.admin-os-action-row {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.admin-os-arrival-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  font-size: 13px;
}

.admin-os-empty {
  text-align: center;
  color: #64748b;
  border: 1px dashed #dbe4f1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 20px 12px;
}

body.desktop-admin .admin-os-shell {
  padding-left: 24px;
  padding-right: 24px;
}

body.desktop-admin .admin-os-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.desktop-admin .admin-os-tabs {
  margin-bottom: 12px;
}

/* ---------- Category Badge (inline) ---------- */
.cat-active-badge { background:#dcfce7; color:#16a34a; }
.cat-inactive-badge { background:#fee2e2; color:#dc2626; }

/* ---------- Form Row (side by side) ---------- */
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group { flex: 1; margin-bottom: 14px; }

/* ---------- Daily Report HQ Summary ---------- */
.dr-hq-summary {
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.dr-hq-summary-main {
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: 14px 16px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(20, 184, 166, 0.22), rgba(20, 184, 166, 0) 65%),
    linear-gradient(135deg, #ecfeff 0%, #f0f9ff 100%);
  box-shadow: 0 10px 20px rgba(14, 116, 144, 0.1);
}

.dr-hq-summary-k {
  font-size: 12px;
  font-weight: 800;
  color: #0f766e;
  letter-spacing: 0.3px;
}

.dr-hq-summary-v {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  color: #0c4a6e;
}

.dr-hq-summary-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #0f766e;
  opacity: 0.9;
}

.dr-hq-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dr-hq-mini-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dr-hq-mini-card span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.dr-hq-mini-card b {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
  color: #0f172a;
}

.dr-hq-mini-card.done {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  border-color: #bbf7d0;
}

.dr-hq-mini-card.done b {
  color: #166534;
}

.dr-hq-mini-card.pending {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
  border-color: #fecdd3;
}

.dr-hq-mini-card.pending b {
  color: #be123c;
}

.dr-hq-mini-card.rate {
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
  border-color: #c7d2fe;
}

.dr-hq-mini-card.rate b {
  color: #3730a3;
}

.dr-hq-store-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dr-hq-store-card {
  border: 1px solid #dbe4f1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.dr-hq-store-card.is-missing {
  border-color: #fecdd3;
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
}

.dr-hq-store-card.is-open {
  border-color: #bfdbfe;
  box-shadow: 0 14px 28px rgba(59, 130, 246, 0.16);
}

.dr-hq-store-head {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.dr-hq-store-head.static {
  cursor: default;
}

.dr-hq-store-meta {
  min-width: 0;
}

.dr-hq-store-name {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
}

.dr-hq-store-meta-line {
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
}

.dr-hq-store-revenue {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #0ea5a3;
}

.dr-hq-store-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dr-hq-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}

.dr-hq-status-pill.done {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.dr-hq-status-pill.missing {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.dr-hq-chevron {
  color: #64748b;
  transition: transform 0.2s ease;
}

.dr-hq-store-detail {
  border-top: 1px solid #e2e8f0;
  padding: 10px 14px 12px;
}

.dr-hq-cat-block + .dr-hq-cat-block {
  margin-top: 10px;
}

.dr-hq-cat-title {
  font-size: 12px;
  font-weight: 800;
  color: #4338ca;
  margin-bottom: 4px;
}

.dr-hq-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.dr-hq-items-table th:first-child,
.dr-hq-items-table td:first-child {
  width: auto;
  padding-right: 10px;
}

.dr-hq-items-table th:nth-child(2),
.dr-hq-items-table td:nth-child(2),
.dr-hq-items-table th:nth-child(3),
.dr-hq-items-table td:nth-child(3) {
  width: 4.5em;
  white-space: nowrap;
}

.dr-hq-items-table th {
  text-align: left;
  padding: 4px;
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}

.dr-hq-items-table th:nth-child(2),
.dr-hq-items-table th:nth-child(3) {
  text-align: right;
}

.dr-hq-items-table td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dr-hq-items-table td.qty {
  text-align: right;
  font-weight: 700;
}

.dr-hq-items-table td.order {
  color: #4338ca;
}

.dr-hq-missing-title {
  font-size: 12px;
  font-weight: 800;
  color: #b45309;
  margin: 12px 0 4px;
}

.dr-hq-missing-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dr-hq-missing-row .qty {
  font-weight: 700;
  color: #7c2d12;
}

.dr-hq-note {
  margin-top: 10px;
  font-size: 12px;
  color: #64748b;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

body.desktop-admin .dr-hq-summary {
  margin-bottom: 14px;
}

body.desktop-admin .dr-hq-store-head {
  padding: 14px 16px;
}

body.desktop-admin .dr-hq-store-detail {
  padding: 12px 16px 14px;
}

@media (max-width: 640px) {
  .dr-hq-summary-v {
    font-size: 26px;
  }

  .dr-hq-summary-metrics {
    grid-template-columns: 1fr;
  }

  .dr-hq-store-head {
    align-items: flex-start;
  }

  .dr-hq-store-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
}

/* ---------- Admin page content padding consistency ---------- */
.admin-page-body { padding: 0 16px 80px; }

/* ---------- MB-2 / MB-3 spacing helpers ---------- */
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }

/* =============================================
   訂單查詢頁 (page-orders / page-my-reservations)
   ============================================= */
.order-search-hero {
  background: linear-gradient(135deg, #111827 0%, #312e81 58%, #1d4ed8 100%);
  padding: 60px 16px 18px;
  margin: 0 12px 8px;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(30, 41, 59, 0.28);
  position: relative;
  overflow: hidden;
}
.order-search-hero::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  top: -120px;
  right: -70px;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.btn-ghost-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 12px; font-weight: 700; padding: 7px 12px;
  border-radius: 100px; white-space: nowrap; cursor: pointer;
  flex-shrink: 0;
}
.badge-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444; border: 1px solid #fff;
}
.order-hero-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px;
}
.order-stat-card {
  background: rgba(255,255,255,.15); border-radius: 14px; padding: 12px; text-align: left;
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.order-stat-card.pickup { cursor: pointer; }
.order-stat-card.pickup:hover { background: rgba(255,255,255,.2); }
.osc-label { font-size: 11px; color: rgba(255,255,255,.75); font-weight: 600; margin-bottom: 4px; }
.osc-value { font-size: 26px; font-weight: 800; color: #fff; line-height: 1; }
.order-stat-card.pickup .osc-value { color: #86efac; }
.o-chip {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; color: #fff;
  padding: 5px 12px; border-radius: 100px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.2);
}
.o-chip-btn { cursor: pointer; }
.o-chip-btn:hover { background: rgba(255,255,255,.22); }
.tab-badge {
  display: inline-flex; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; font-size: 10px; font-weight: 800; margin-left: 3px;
  background: #ef4444; color: #fff; align-items: center; justify-content: center;
}

/* Order legend */
.order-legend-wrap { font-size: 13px; }
.order-legend-wrap summary {
  cursor: pointer; font-weight: 600; color: var(--text-muted); font-size: 12px;
  padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 4px;
}
.order-legend-wrap summary::-webkit-details-marker { display: none; }
.order-legend-grid {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px;
}

#page-orders {
  background: radial-gradient(circle at top, #f8fbff 0, #f7f8fc 35%, #f4f6fa 100%);
}
#page-orders #orders-content {
  max-width: 980px;
  margin: 0 auto;
}
#page-orders #order-tabs {
  position: sticky;
  top: 60px;
  z-index: 20;
  background: rgba(247, 248, 252, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
#page-orders #order-tabs .tab {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: #475569;
  font-weight: 700;
}
#page-orders #order-tabs .tab:hover {
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
}
#page-orders #order-tabs .tab.active {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}
#page-orders #orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px !important;
}
.lchip {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; border: 1px solid transparent;
}
.lchip.blue   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.lchip.indigo { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.lchip.cyan   { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.lchip.green  { background: #dcfce7; color: #16a34a; border-color: #86efac; }
.lchip.gray   { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.lchip.red    { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* Rich order track card */
.order-track-card {
  background: var(--bg-white); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 10px;
}
.order-track-card.is-pickup { border-left: 3px solid #16a34a; }
.order-track-card.is-cancelled { opacity: .68; }
.ot-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.ot-store-chip {
  font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg); padding: 2px 8px; border-radius: 8px;
}
.ot-status-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; white-space: nowrap;
  color: #fff;
}
.ot-status-badge.s-pending  { background: #3b82f6; }
.ot-status-badge.s-confirmed{ background: #4338ca; }
.ot-status-badge.s-shipping { background: #0891b2; }
.ot-status-badge.s-arrived  { background: #16a34a; }
.ot-status-badge.s-picked_up{ background: #6b7280; }
.ot-status-badge.s-cancelled{ background: #ef4444; }
.ot-product-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ot-thumb {
  width: 56px; height: 56px; border-radius: 10px; background: var(--bg); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.ot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ot-product-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.ot-pickup-date {
  display: flex; align-items: center; gap: 8px;
  background: #f0fdf4; border-left: 3px solid #16a34a; padding: 8px 10px; border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
}
.ot-spec-surface { background: var(--bg); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.ot-spec-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.ot-total-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0 0; border-top: 1px solid var(--border); margin-top: 4px; }
.ot-total-row span:last-child { font-size: 17px; font-weight: 800; color: var(--primary); }
.ot-action-btn {
  width: 100%; padding: 10px; border-radius: 100px; font-size: 13px; font-weight: 700;
  text-align: center; cursor: pointer; border: 1px solid transparent;
}
.ot-action-btn.modify {
  background: #fff7ed; color: #c2410c; border-color: #fdba74;
}
.ot-action-btn.inactive {
  background: var(--bg); color: var(--text-muted); cursor: default;
}
.ot-arrived-banner {
  background: #dcfce7; color: #16a34a; font-weight: 700; font-size: 12px;
  padding: 8px 12px; border-radius: 8px; text-align: center;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.65} }

/* =============================================
   會員中心 (page-profile hub)
   ============================================= */
.member-hero-card {
  border-radius: 0 0 24px 24px;
  margin: 0 -16px 16px;
  padding: 60px 16px 20px;
}
.member-section {
  background: var(--bg-white); border-radius: 16px; padding: 16px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 12px;
}
.member-section.amber { border-color: #fde68a; background: linear-gradient(135deg,#fffbeb,#fff); }
.member-section.rose  { border-color: #fecdd3; background: linear-gradient(135deg,#fff1f2,#fff); }
.member-section.slate { border-color: var(--border); background: linear-gradient(135deg,#f8fafc,#fff); }
.member-section.green { border-color: #bbf7d0; background: linear-gradient(135deg,#f0fdf4,#fff); }
.member-action-btn {
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 14px; padding: 14px 12px;
  text-align: left; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: transform .15s, box-shadow .15s;
}
.member-action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.mab-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 16px; margin-bottom: 10px;
}
.mab-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.mab-sub { font-size: 11px; color: var(--text-muted); }
.member-setting-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; cursor: pointer; text-align: left;
  transition: background .15s;
}
.member-setting-item:hover { background: var(--bg); }
.member-setting-item.danger:hover { background: #fff5f5; border-color: #fecaca; }

/* ──── Profile Hero (新設計) ──── */
.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #e85610 60%, #c94400 100%);
  padding: 72px 0 26px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 6px 28px rgba(255,107,53,0.3);
}
.profile-hero-decor { position: absolute; inset: 0; pointer-events: none; }
.profile-hero-circle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.profile-hero-circle.c1 { width: 200px; height: 200px; top: -60px; right: -50px; }
.profile-hero-circle.c2 { width: 130px; height: 130px; bottom: -30px; left: -30px; }
/* Profile Quick Buttons */
.profile-quick-btn {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 14px;
  text-align: left; cursor: pointer; width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.profile-quick-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pqb-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
}
.pqb-label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.pqb-sub { font-size: 11px; color: var(--text-muted); }
/* Profile Menu Items */
.profile-menu-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; text-align: left;
  transition: background .15s; background: none;
}
.profile-menu-item:hover { background: var(--bg); }
.pmi-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.pmi-label { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.pmi-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pmi-divider { height: 1px; background: var(--border); margin: 0 16px; }
.pmi-arrow { color: var(--text-light); font-size: 11px; }

/* ══════════════════════════════════════════════════════
   ✨ 視覺設計增強 v2 — 高質感 UI全面升級
   ══════════════════════════════════════════════════════ */

/* —— 補充設計 Variables —— */
:root {
  --card-bg: #ffffff;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 10px 32px rgba(0,0,0,0.13), 0 3px 10px rgba(0,0,0,0.07);
  --border-light: rgba(0,0,0,0.06);
  --text-secondary: #4a4a6a;
  --gradient-primary: linear-gradient(135deg, #C24A1D 0%, #e85610 100%);
  --gradient-warm: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
  --gradient-cool: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --glow-primary: 0 4px 20px rgba(255,107,53,0.3);
  --noise-overlay: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* —— App 背景 —— */
#app {
  background: #f8f8fa;
}

/* —— Header 玻璃擬態 + 精緻化 —— */
#main-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(200%) blur(20px);
  -webkit-backdrop-filter: saturate(200%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.07);
}
.logo span {
  background: linear-gradient(135deg, #C24A1D 20%, #e84e00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.logo i { color: var(--primary); }

/* —— Bottom Nav 玻璃效果 + Active 指示線 —— */
.bottom-nav {
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 -6px 28px rgba(0,0,0,0.09);
}
.bottom-nav-item {
  position: relative;
  transition: color 0.2s;
}
.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: linear-gradient(90deg, #C24A1D, #e84e00);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 8px rgba(255,107,53,0.5);
}
.bottom-nav-item.active i {
  transform: scale(1.18) translateY(-1px);
  filter: drop-shadow(0 2px 5px rgba(255,107,53,0.45));
}
.bottom-nav-item i {
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), color 0.2s;
}

/* —— Page Header 升級 —— */
.page-header {
  padding: 20px 16px 10px;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #1a1a2e;
}
.page-header h2 .fa, .page-header h2 .fas, .page-header h2 .far {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

/* —— Section Title 左 accent 條 —— */
.section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #1a1a2e;
  position: relative;
  padding-left: 13px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* —— 通用 Card 升級 —— */
.card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 18px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.03);
  transition: box-shadow 0.22s, transform 0.22s;
}
.card.clickable:hover, .clickable.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 14px;
}

/* —— Buttons 全面升級 —— */
.btn {
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.btn-primary {
  background: linear-gradient(135deg, #C24A1D 0%, #e85610 100%);
  box-shadow: 0 4px 16px rgba(255,107,53,0.38), 0 1px 4px rgba(255,107,53,0.2);
  border: none;
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(255,107,53,0.5), 0 2px 8px rgba(255,107,53,0.25);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.97) translateY(0);
  box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}
.btn-lg {
  border-radius: 14px;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.btn-outline {
  border: 1.5px solid rgba(0,0,0,0.12);
  color: #444;
  background: rgba(255,255,255,0.9);
  border-radius: 11px;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255,107,53,0.04);
}
.btn-danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 3px 12px rgba(239,68,68,0.3);
  border: none;
}
.btn-success {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 3px 12px rgba(16,185,129,0.3);
  border: none;
}

/* —— Product Card 升級 —— */
.product-card {
  border: none;
  border-radius: 18px;
  box-shadow: 0 3px 16px rgba(0,0,0,0.09), 0 1px 5px rgba(0,0,0,0.05);
  transition: all 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  position: relative;
}

.pd-deadline-line {
  font-size: 13px; font-weight: 700; color: var(--primary);
  margin: 4px 0 2px; letter-spacing: 0.2px;
}
/* 隱藏數字輸入框原生上下箭頭 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.product-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 16px 40px rgba(0,0,0,0.15), 0 5px 14px rgba(0,0,0,0.07);
}
.product-img-placeholder {
  background: linear-gradient(145deg, #f0f0f4 0%, #e4e4ea 100%);
  color: rgba(0,0,0,0.12);
}
.product-price {
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #e84e00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.product-name { font-size: 15px; font-weight: 800; }
.product-info { padding: 12px 12px 10px; }
/* 特別標籤升級 */
.special-tag-flash {
  position: absolute; top: 0; right: 10px; z-index: 5;
  background: linear-gradient(135deg, #ff4e00, #ec9f05);
  color: #fff; font-size: 12px; font-weight: 900;
  padding: 4px 11px 7px; letter-spacing: 0.3px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 14px rgba(255,78,0,0.55);
  animation: specialTagPulse 1.6s ease-in-out infinite;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
/* 下單人數熱度標籤 */
.order-count-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 20px;
  background: linear-gradient(135deg, #fff0f0, #ffe4e4);
  color: #dc2626;
  border: 1px solid rgba(220,38,38,0.18);
  box-shadow: 0 1px 4px rgba(220,38,38,0.12);
}
.deadline-chip {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1px solid rgba(245,158,11,0.2);
  color: #d97706;
}
.product-tag {
  background: rgba(255,107,53,0.1);
  color: #e85610;
  font-weight: 700;
  border-radius: 6px;
}

/* —— Order Card 升級（左側 accent 條 + 層次陰影）—— */
.order-card {
  margin: 0 16px 14px;
  background: #fff;
  border: none;
  border-radius: 18px;
  box-shadow: 0 3px 18px rgba(0,0,0,0.08), 0 1px 5px rgba(0,0,0,0.04);
  overflow: hidden;
  position: relative;
}
.order-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--gradient-primary);
  border-radius: 5px 0 0 5px;
}
.order-card[data-status="pending"]::before   { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.order-card[data-status="confirmed"]::before { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.order-card[data-status="shipping"]::before  { background: linear-gradient(180deg, #22d3ee, #0891b2); }
.order-card[data-status="arrived"]::before   { background: linear-gradient(180deg, #34d399, #10b981); }
.order-card[data-status="completed"]::before { background: linear-gradient(180deg, #9ca3af, #6b7280); }
.order-card[data-status="cancelled"]::before { background: linear-gradient(180deg, #f87171, #ef4444); }
.order-card-header {
  background: rgba(248,248,250,0.8);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  padding: 12px 14px 10px 20px;
}
.order-card-body { padding: 12px 14px 10px 20px; }
.order-card-footer {
  border-top: 1px solid rgba(0,0,0,0.04);
  background: rgba(255,107,53,0.02);
  padding: 10px 14px 10px 20px;
}
.order-no { font-weight: 800; color: #1a1a2e; }

/* —— Order Status Badge 升級 —— */
.order-status {
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.os-pending   { background: #fef9c3; color: #ca8a04; border: 1px solid rgba(202,138,4,0.2);  }
.os-confirmed { background: #eff6ff; color: #2563eb; border: 1px solid rgba(37,99,235,0.2);  }
.os-shipping  { background: #ecfeff; color: #0e7490; border: 1px solid rgba(14,116,144,0.2); }
.os-arrived   { background: #f0fdf4; color: #16a34a; border: 1px solid rgba(22,163,74,0.2);  }
.os-completed { background: #f4f4f5; color: #71717a; border: 1px solid rgba(113,113,122,0.2);}
.os-cancelled { background: #fef2f2; color: #dc2626; border: 1px solid rgba(220,38,38,0.2);  }
.os-queued    { background: #fff7ed; color: #c2410c; border: 1px solid rgba(194,65,12,0.2);   }
.os-abandoned { background: #fef2f2; color: #9ca3af; border: 1px solid rgba(156,163,175,0.2); }
.os-group_closed { background: #eef2ff; color: #4338ca; border: 1px solid rgba(67,56,202,0.2); }

/* —— Stat Cards 漸層背景 + 裝飾圓 —— */
.stats-grid { gap: 12px; }
.stat-card {
  border: none;
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -14px; bottom: -14px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  pointer-events: none;
}
.stat-card:nth-child(1) { background: linear-gradient(135deg, #C24A1D 0%, #e84e00 100%); color: #fff; }
.stat-card:nth-child(2) { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.stat-card:nth-child(3) { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; }
.stat-card:nth-child(4) { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: #fff; }
.stat-card:nth-child(1) .stat-label,
.stat-card:nth-child(2) .stat-label,
.stat-card:nth-child(3) .stat-label,
.stat-card:nth-child(4) .stat-label { color: rgba(255,255,255,0.78); }
.stat-card:nth-child(1) .stat-value,
.stat-card:nth-child(2) .stat-value,
.stat-card:nth-child(3) .stat-value,
.stat-card:nth-child(4) .stat-value { color: #fff; }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,0.22);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  color: #fff;
}
.stat-value {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.1;
}
.stat-label { font-size: 12px; margin-top: 3px; }

/* —— Tabs / 篩選標籤 升級 —— */
.tab {
  padding: 7px 16px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0,0,0,0.05);
  border: none;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.tab.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,53,0.4);
  transform: scale(1.02);
}
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px;
  border-radius: 9px; padding: 0 4px;
  font-size: 10px; font-weight: 800;
  margin-left: 4px;
}
.tab.active .tab-badge {
  background: rgba(255,255,255,0.3);
  color: #fff;
}
.tab:not(.active) .tab-badge {
  background: #ef4444;
  color: #fff;
}

/* —— Tab Group 容器 —— */
.tab-group .tab.active { background: var(--gradient-primary); }

/* —— Filter Bar 搜尋框升級 —— */
.search-wrap input {
  border: 1.5px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.95);
  border-radius: 30px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  transition: all 0.22s;
}
.search-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12), 0 2px 10px rgba(0,0,0,0.06);
}
.form-control {
  border: 1.5px solid rgba(0,0,0,0.09);
  border-radius: 11px;
  background: #fafafa;
  transition: all 0.2s;
}
.form-control:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1), 0 1px 6px rgba(0,0,0,0.05);
}

/* —— Banner 增強 —— */
.banner {
  padding: 32px 20px 40px;
  background: linear-gradient(135deg, #C24A1D 0%, #e84e00 55%, #c13b00 100%);
}
.banner h1 {
  line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0,0,0,0.22);
}
.banner-circle.c1 { width: 180px; height: 180px; top: -50px; right: -50px; background: rgba(255,255,255,0.13); }
.banner-circle.c2 { width: 100px; height: 100px; top: 50px; right: 50px; background: rgba(255,255,255,0.09); }
.banner-circle.c3 { width: 150px; height: 150px; bottom: -50px; right: 10px; background: rgba(255,255,255,0.07); }

/* —— Category Chips 升級 —— */
.category-chip {
  background: #fff;
  border-radius: 14px;
  padding: 14px 8px;
  border: 1.5px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  transition: all 0.2s;
}
.category-chip:hover {
  border-color: var(--primary);
  background: #fff5f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,107,53,0.18);
}
.category-chip.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fff5f0, #fff0ea);
  box-shadow: 0 4px 16px rgba(255,107,53,0.22);
}
.category-chip .icon { font-size: 24px; }
.category-chip .label { font-size: 11px; font-weight: 700; }

/* —— Wallet Hero 升級 —— */
.wallet-hero {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  border-radius: 22px;
  box-shadow: 0 8px 36px rgba(251,191,36,0.4), 0 2px 12px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}
.wallet-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  pointer-events: none;
}
.wallet-hero::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -20px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}
.wallet-hero .balance-big {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -1.5px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* —— Checkin Hero 升級 —— */
.checkin-hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  border-radius: 22px;
  box-shadow: 0 8px 36px rgba(139,92,246,0.4), 0 2px 12px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}
.checkin-hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  pointer-events: none;
}
.checkin-hero::after {
  content: '';
  position: absolute;
  bottom: -20px; left: -10px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.09);
  pointer-events: none;
}
.checkin-hero .big-num {
  text-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.checkin-btn {
  width: 92px; height: 92px;
  background: rgba(255,255,255,0.22);
  border: 3px solid rgba(255,255,255,0.65);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}
.cal-day.checked {
  background: linear-gradient(135deg, var(--primary), #e84e00);
  box-shadow: 0 2px 8px rgba(255,107,53,0.4);
}
.reward-rule {
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.05);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.reward-rule.achieved {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: rgba(22,163,74,0.2);
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary), #e84e00);
}

/* —— Coupon Card 升級 —— */
.coupon-card {
  border: none;
  border-radius: 18px;
  box-shadow: 0 4px 22px rgba(0,0,0,0.09), 0 1px 6px rgba(0,0,0,0.04);
}
.coupon-left {
  border-radius: 18px 0 0 18px;
  background: linear-gradient(160deg, #C24A1D 0%, #e84e00 100%);
}
.coupon-left.percent-type {
  background: linear-gradient(160deg, #7c3aed 0%, #6d28d9 100%);
}
.coupon-notch::before, .coupon-notch::after {
  background: #f8f8fa;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.07);
}
.coupon-value { font-size: 24px; font-weight: 900; }

/* —— Auth Card 升級 —— */
.auth-card {
  border: none;
  border-radius: 24px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.13), 0 2px 12px rgba(0,0,0,0.06);
  padding: 32px 28px;
}
.auth-tabs {
  background: rgba(0,0,0,0.05);
  border-radius: 12px;
}
.auth-tab.active {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-radius: 10px;
}

/* —— Modal 升級（精緻底部 Sheet）—— */
.modal-box {
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -6px 50px rgba(0,0,0,0.2);
}
.modal-header {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #1a1a2e;
}
.modal-footer {
  border-top: 1px solid rgba(0,0,0,0.06);
}
.modal-box::before {
  content: '';
  display: block;
  width: 40px; height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.14);
  margin: 10px auto -6px;
  flex-shrink: 0;
}
.modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

/* —— Notification Items —— */
.notif-item {
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background 0.15s;
}
.notif-item.unread {
  background: linear-gradient(90deg, #fff8f5 0%, #fff 100%);
  border-left: 3px solid var(--primary);
}
.notif-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* —— Store Admin Card 升級 —— */
.store-admin-card {
  border: none;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 3px 18px rgba(0,0,0,0.07), 0 1px 5px rgba(0,0,0,0.03);
  background: linear-gradient(180deg, #ffffff 0%, #fafafe 100%);
  position: relative;
  overflow: hidden;
}
.store-admin-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 18px 18px 0 0;
}
.store-admin-card .store-title { color: #1a1a2e; }

/* —— Announcement Card 升級 —— */
.announcement-card {
  border-radius: 14px;
  border-left: none;
  padding-left: 18px;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.announcement-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  border-radius: 5px 0 0 5px;
}
.ann-normal  { background: linear-gradient(135deg, #eff6ff, #f5f9ff); border-color: transparent; }
.ann-normal::before  { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.ann-important { background: linear-gradient(135deg, #fef2f2, #fff5f5); border-color: transparent; }
.ann-important::before { background: linear-gradient(180deg, #f87171, #ef4444); }
.ann-sale { background: linear-gradient(135deg, #fffbeb, #fffef5); border-color: transparent; }
.ann-sale::before { background: linear-gradient(180deg, #fcd34d, #f59e0b); }

/* —— Deadline Banner 升級 —— */
.deadline-banner {
  background: linear-gradient(135deg, #C24A1D 0%, #e84e00 100%);
  border-radius: 18px;
  box-shadow: 0 6px 28px rgba(255,107,53,0.35);
}

/* —— Profile/Member Section 升級 —— */
.member-section {
  border-radius: 18px;
  border: none;
  box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}
.member-section.amber {
  background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%);
  border: 1px solid rgba(251,191,36,0.2);
}
.member-section.rose {
  background: linear-gradient(135deg, #fff1f2 0%, #fff5f5 100%);
  border: 1px solid rgba(251,113,133,0.2);
}
.member-section.green {
  background: linear-gradient(135deg, #f0fdf4 0%, #f5fff7 100%);
  border: 1px solid rgba(34,197,94,0.18);
}
.member-section.slate {
  background: linear-gradient(135deg, #f8fafc 0%, #fafbfd 100%);
  border: 1px solid rgba(0,0,0,0.06);
}
.member-action-btn {
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.member-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* —— Sidebar 升級 —— */
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fafafe 100%);
  box-shadow: 6px 0 40px rgba(0,0,0,0.16);
}
.sidebar-header {
  background: linear-gradient(135deg, rgba(255,107,53,0.06) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-item {
  border-left: 3px solid transparent;
  border-radius: 0 10px 10px 0;
  margin-right: 8px;
  transition: all 0.18s ease;
}
.nav-item:hover {
  background: linear-gradient(90deg, rgba(255,107,53,0.08) 0%, rgba(255,107,53,0.02) 100%);
  border-left-color: var(--primary);
  padding-left: 17px;
  color: var(--primary);
}
.nav-section-title {
  font-size: 10px;
  color: rgba(0,0,0,0.3);
  letter-spacing: 1.8px;
}

/* —— Empty State 升級 —— */
.empty-state {
  padding: 60px 32px;
}
.empty-state .fa-3x, .empty-state .fas.fa-3x {
  opacity: 0.3;
}

/* —— Loading Spinner —— */
.loading-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 56px 0;
}
.spinner {
  border: 3px solid rgba(255,107,53,0.15);
  border-top-color: var(--primary);
  box-shadow: 0 0 14px rgba(255,107,53,0.12);
}

/* —— 全域滾動條美化 —— */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.13); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.23); }

/* —— Toast 升級 —— */
.toast {
  border-radius: 14px;
  padding: 13px 22px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.22);
  font-weight: 600;
}
.toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.toast.error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast.warning { background: linear-gradient(135deg, #d97706, #f59e0b); }

/* —— Badge 升級（通知角標）—— */
.badge {
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(231,76,60,0.4);
}

/* —— Tag Badges 升級 —— */
.tag-active  { background: #dcfce7; color: #16a34a; border: 1px solid rgba(22,163,74,0.2); }
.tag-closed  { background: #f4f4f5; color: #71717a; border: 1px solid rgba(0,0,0,0.08); }
.tag-soldout { background: #fef2f2; color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.tag-pending { background: #fef9c3; color: #ca8a04; border: 1px solid rgba(202,138,4,0.18); }
.tag-done    { background: #eff6ff; color: #2563eb; border: 1px solid rgba(37,99,235,0.2); }

/* —— 成功頁 升級 —— */
.order-no-display {
  background: linear-gradient(135deg, rgba(255,107,53,0.06), rgba(255,107,53,0.02));
  border: 2px dashed rgba(255,107,53,0.3);
  border-radius: 14px;
  font-size: 20px;
}

/* —— ot-status-badge 升級（加陰影）—— */
.ot-status-badge {
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  font-size: 11px;
}

/* —— Store Info Consumer Card（JS 生成，外層 card 已繼承升級）—— */
/* 強化 JS 渲染的 store card 陰影 */
#store-info-list .card {
  box-shadow: 0 4px 22px rgba(0,0,0,0.09), 0 1px 6px rgba(0,0,0,0.04);
  border-radius: 20px;
  overflow: hidden;
}

/* —— 消費者 門市資訊卡片（全新設計）—— */
.si-card {
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-white);
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 6px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}

/* 頂部彩色 Banner */
.si-header {
  padding: 16px 16px 14px;
  color: #fff;
}
.si-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
/* 門市序號圓圈 */
.si-index {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}
.si-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #fff;
}
.si-addr {
  font-size: 12px;
  color: rgba(255,255,255,0.82);
  margin-top: 4px;
  line-height: 1.4;
}
/* 營業狀態徽章 */
.si-status-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.40);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* 卡片內容區 */
.si-body {
  padding: 14px 16px 14px;
}

/* 資訊列區塊 */
.si-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.si-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}
.si-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.si-text {
  flex: 1;
  color: var(--text-primary);
  line-height: 1.4;
}

/* 近期公休區塊 */
.si-closure {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.si-closure-title {
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 7px;
}
.si-closure-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.si-closure-chip {
  font-size: 12px;
  background: #fee2e2;
  color: #7f1d1d;
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
}

/* 動作按鈕列 */
.si-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.si-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.si-btn:active { opacity: .75; }
.si-btn-map {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.si-btn-line {
  background: #06c755;
  color: #fff;
}

/* 進入門市大按鈕 */
.si-btn-shop {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg,#4338ca 0%,#6366f1 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
  transition: opacity .15s;
}
.si-btn-shop:active { opacity: .82; }
.si-btn-shop--disabled {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: not-allowed !important;
  border: 1px dashed #cbd5e1 !important;
}

/* —— Product List Item 升級 —— */
.product-list-item {
  border: none;
  border-radius: 18px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.03);
  background: #fff;
  padding: 16px;
}
.pli-thumb {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* —— Uncollected card hover —— */
.uncollected-product-row:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 4px 16px rgba(255,107,53,0.15) !important;
}

/* —— Quick Access Row 升級 —— */
.quick-access {
  border-top: 1px solid rgba(0,0,0,0.04);
  background: #fff;
  border-radius: 0 0 18px 18px;
  margin: 0;
}
.qa-item {
  padding: 16px 6px;
}
.qa-item:hover {
  background: linear-gradient(180deg, rgba(255,107,53,0.06), transparent);
  color: var(--primary);
}
.qa-item .qa-icon { font-size: 24px; }

/* —— Payment Option 升級 —— */
.payment-option {
  border: 2px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.payment-option.active,
.payment-option:has(input:checked) {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fff5f0, #fff0ea);
  box-shadow: 0 4px 16px rgba(255,107,53,0.2);
}

/* —— Cart Item 升級 —— */
.cart-item {
  padding: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background 0.15s;
}
.cart-item:hover { background: #fafafa; }
.cart-item-img {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.cart-summary {
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f7 100%);
  border-top: 1px solid rgba(0,0,0,0.05);
  border-radius: 0 0 18px 18px;
}

/* —— Summary Row Total 升級 —— */
.summary-row.total {
  font-size: 18px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.summary-row.total span:last-child {
  background: linear-gradient(135deg, var(--primary), #e84e00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* —— Stat Mini 升級 —— */
.stat-mini {
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.stat-mini-val {
  background: linear-gradient(135deg, var(--primary), #e84e00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* —— Profile Stat 升級 —— */
.profile-stat {
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 4px;
}

/* —— 通用動畫增強 —— */
@media (prefers-reduced-motion: no-preference) {
  .product-card, .order-card, .coupon-card, .card, .store-admin-card {
    will-change: transform;
  }
  .bottom-nav-item.active i {
    animation: navIconBounce 0.35s cubic-bezier(0.34,1.56,0.64,1);
  }
  @keyframes navIconBounce {
    0%   { transform: scale(0.9); }
    100% { transform: scale(1.18) translateY(-1px); }
  }
}

/* ===========================================
   �ӫ~�W��/�ʪ���/���b v2
   =========================================== */

/* ---- Product Card ---- */
.spec-count-badge {
  font-size: 10px; padding: 2px 6px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 10px; font-weight: 600;
}
.pinned-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; background: rgba(0,0,0,.55); color: #fff;
  padding: 2px 7px; border-radius: 10px; backdrop-filter: blur(4px);
}
.product-card { position: relative; }

/* ── C10 開賣倒數卡 ─────────────────────────── */
.product-card--countdown {
  cursor: default;
  pointer-events: none;
}
.product-card--countdown:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}
.product-card--countdown::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.40);
  z-index: 1;
  border-radius: inherit;
}
.countdown-overlay {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  color: #fff;
  pointer-events: none;
}
.countdown-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,.22);
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 4px;
  display: inline-block;
  backdrop-filter: blur(4px);
  letter-spacing: .4px;
}
.countdown-timer {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
  animation: countdown-pulse 1s ease-in-out infinite;
  display: block;
}
.countdown-unit {
  font-size: 13px;
  font-weight: 600;
  opacity: .9;
  margin-top: 2px;
  display: block;
}
@keyframes countdown-pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}


/* ---- Product Detail ---- */
.pd-shell { background: var(--bg-white); }
.pd-gallery { position: relative; }
.pd-main-img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #fff; display: block; }
.pd-thumbs {
  display: flex; gap: 6px; padding: 8px 12px;
  overflow-x: auto; background: var(--bg);
}
.pd-thumb {
  width: 56px; height: 56px; object-fit: contain; background: #fff;
  border-radius: 6px; border: 2px solid transparent;
  cursor: pointer; flex-shrink: 0; transition: var(--transition);
}
.pd-thumb.active { border-color: var(--primary); }
.pd-no-img {
  width: 100%; aspect-ratio: 1/1;
  background: linear-gradient(135deg,#f5f5f5,#e8e8e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
}
.pd-body-shell {
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
}
.pd-summary-card,
.pd-surface {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.pd-summary-card {
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}
.pd-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pd-category-chip {
  padding: 4px 10px !important;
  font-size: 12px !important;
  line-height: 1.2;
}
.pd-share-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.pd-share-btn:hover { background: var(--primary-light); border-color: rgba(255,107,53,.26); }
.pd-deadline-line {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid rgba(194,65,12,.14);
  border-radius: 10px;
  padding: 7px 10px;
}
.pd-from-label { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 2px; }

.pd-section { margin: 12px 0; }
.pd-surface { padding: 14px; }
.pd-section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px;
}

/* Spec Buttons */
.pd-spec-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pd-spec-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  min-width: 0;
  width: 100%;
  min-height: 84px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-white); cursor: pointer;
  transition: var(--transition); text-align: left;
}
.pd-spec-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.pd-spec-btn.active {
  border-color: var(--primary); background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.pd-spec-btn:disabled,
.pd-spec-btn.sold-out { opacity: .55; }
.pd-spec-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.pd-spec-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.pd-spec-stock {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 0;
  line-height: 1.25;
  flex: 1 1 88px;
}
.pd-spec-stock.low { color: var(--danger); font-weight: 600; }
.pd-spec-stock.queue { color: #c2410c; font-weight: 700; }
.pd-spec-price {
  font-size: 15px;
  color: var(--primary);
  font-weight: 800;
  margin-top: 0;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Price Tier Table */
.pd-tier-table { display: flex; flex-direction: column; gap: 6px; }
.pd-tier-row {
  display: flex; align-items: center; gap: 0;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
}
.pd-tier-row.base-tier { border-color: var(--border); background: var(--bg); }
.pd-tier-qty { font-size: 14px; font-weight: 700; width: 56px; flex-shrink: 0; color: var(--text); }
.pd-tier-price { font-size: 20px; font-weight: 900; color: var(--primary); flex: 1; }
.pd-tier-unit { font-size: 12px; color: var(--text-muted); }

/* Qty + Price Result */
.pd-qty-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 12px;
  justify-content: space-between;
}
.pd-price-result { display: flex; flex-direction: column; align-items: flex-end; }
.pd-unit-text { font-size: 12px; color: var(--text-muted); }
.pd-total-text { font-size: 24px; font-weight: 900; color: var(--primary); line-height: 1.1; }

/* ---- 取貨日期選擇 ---- */
.pd-pickup-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.pd-pickup-btn {
  padding: 10px 12px; border: 2px solid var(--border);
  border-radius: 10px; background: var(--bg-white);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.18s; color: var(--text);
  line-height: 1.35; min-width: 0; min-height: 48px;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.pd-pickup-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pd-pickup-btn.active {
  border-color: var(--primary); background: var(--primary);
  color: #fff; box-shadow: 0 3px 12px rgba(255,107,53,0.35);
}

/* ---- 改單申請 type 按鈕 ---- */
.change-type-btns { display: flex; gap: 8px; margin-bottom: 16px; }
.change-type-btn {
  flex: 1; padding: 10px 6px; border: 2px solid var(--border);
  border-radius: 10px; background: var(--bg-white);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.18s; color: var(--text-muted); text-align: center;
}
.change-type-btn:hover { border-color: var(--primary); color: var(--primary); }
.change-type-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 3px 12px rgba(255,107,53,0.3); }
.change-type-btn.cancel-type.active { border-color: var(--danger); background: var(--danger); box-shadow: 0 3px 12px rgba(239,68,68,0.3); }

/* ---- 改單改規格行 ---- */
.change-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.change-qty-row:last-child { border-bottom: none; }
.change-qty-name { flex: 1; font-size: 14px; font-weight: 600; }
.change-qty-spec { flex: 1; font-size: 14px; font-weight: 600; }
.change-qty-old { font-size: 12px; color: var(--text-muted); min-width: 36px; }
.change-qty-ctrl { display: flex; align-items: center; gap: 6px; }

/* ================================================================
   電腦版後台模式  body.desktop-admin
   ================================================================ */

/* --- CSS 變數 --- */
:root {
  --da-sidebar-w:      260px;
  --da-sidebar-bg:     #1a1d2e;
  --da-sidebar-border: rgba(255,255,255,0.07);
  --da-sidebar-text:   #94a3b8;
  --da-sidebar-hover:  rgba(255,255,255,0.07);
  --da-accent:         #C24A1D;
  --da-bg:             #f0f2f6;
  --da-header-bg:      #ffffff;
  --da-card-bg:        #ffffff;
}

/* --- 全域佈局 --- */
body.desktop-admin { background: var(--da-bg); }

body.desktop-admin #app {
  max-width: 100% !important;
  box-shadow: none !important;
  background: var(--da-bg) !important;
}

/* --- 側欄常駐 --- */
body.desktop-admin .sidebar-overlay { display: none !important; }

body.desktop-admin .sidebar {
  left: 0 !important;
  width: var(--da-sidebar-w) !important;
  height: 100vh !important;
  background: var(--da-sidebar-bg) !important;
  border-right: 1px solid var(--da-sidebar-border) !important;
  transition: none !important;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 隱藏關閉按鈕 */
body.desktop-admin .sidebar-header .icon-btn { display: none !important; }
body.desktop-admin .sidebar-header {
  border-bottom: 1px solid var(--da-sidebar-border) !important;
  padding: 0 20px;
  height: 64px;
}

/* 側欄 Logo */
body.desktop-admin .sidebar .logo { color: #ffffff; }
body.desktop-admin .sidebar .logo i { color: var(--da-accent); }

/* 側欄導覽文字 */
body.desktop-admin .nav-section-title {
  color: rgba(148,163,184,0.45);
  font-size: 10px;
  letter-spacing: 0.10em;
  padding: 12px 20px 4px;
}

body.desktop-admin .nav-item {
  color: var(--da-sidebar-text);
  border-radius: 8px;
  margin: 1px 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  gap: 10px;
}
body.desktop-admin .nav-item:hover {
  background: var(--da-sidebar-hover) !important;
  color: #ffffff !important;
}

body.desktop-admin .nav-category-header {
  color: rgba(148,163,184,0.55);
  font-size: 10.5px;
  font-weight: 800;
  padding: 10px 20px 5px;
  letter-spacing: 0.09em;
  border-radius: 0;
  background: transparent !important;
}
body.desktop-admin .nav-category-header:hover { background: transparent !important; }

body.desktop-admin .nav-item.nav-sub {
  color: rgba(148,163,184,0.80);
  font-size: 13px;
  padding: 9px 12px 9px 18px;
}
body.desktop-admin .nav-item.nav-sub:hover {
  color: #ffffff !important;
  background: var(--da-sidebar-hover) !important;
}

/* 側欄底部 */
body.desktop-admin .sidebar-footer {
  border-top: 1px solid var(--da-sidebar-border) !important;
}
body.desktop-admin .sidebar-user .fw-bold { color: #ffffff; }
body.desktop-admin .sidebar-user .text-muted { color: var(--da-sidebar-text); }
body.desktop-admin .sidebar .btn-outline {
  border-color: rgba(255,255,255,0.15);
  color: var(--da-sidebar-text);
}
body.desktop-admin .sidebar .btn-outline:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}
body.desktop-admin .sidebar .avatar {
  background: linear-gradient(135deg, var(--da-accent), #ff4e00);
}

/* 電腦版切換按鈕樣式（在深色側欄中） */
body.desktop-admin #btn-desktop-mode {
  background: rgba(255,107,53,0.12);
  border-color: rgba(255,107,53,0.35) !important;
  color: var(--da-accent);
}
body.desktop-admin #btn-desktop-mode:hover {
  background: rgba(255,107,53,0.22);
}

/* --- Header 調整 --- */
body.desktop-admin #main-header {
  left: var(--da-sidebar-w) !important;
  max-width: calc(100% - var(--da-sidebar-w)) !important;
  transform: none !important;
  width: calc(100% - var(--da-sidebar-w)) !important;
  background: var(--da-header-bg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.07);
  height: 64px;
}

/* --- 主內容區 --- */
body.desktop-admin #main-content {
  margin-left: var(--da-sidebar-w);
  padding-top: 64px;
  padding-bottom: 40px;
  background: var(--da-bg);
  min-height: 100vh;
}

/* --- 隱藏手機專用元素 --- */
body.desktop-admin .bottom-nav,
body.desktop-admin #bottom-nav,
body.desktop-admin #bottom-nav-store { display: none !important; }

/* --- 桌機版 Card 調整 --- */
body.desktop-admin .card {
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

/* --- 後台頁面標題 --- */
body.desktop-admin .page-header {
  padding: 20px 24px 12px;
}

/* --- 統計卡片 4 欄（避免 6 欄太擠） --- */
body.desktop-admin #admin-stats {
  grid-template-columns: repeat(4, 1fr) !important;
}

/* --- 待辦 Grid 4 欄 --- */
body.desktop-admin #admin-pending-grid {
  grid-template-columns: repeat(4, 1fr) !important;
}

/* --- 快捷功能 6 欄 --- */
body.desktop-admin #admin-quick-actions-grid {
  grid-template-columns: repeat(6, 1fr) !important;
}

/* --- 後台頁面：限制最大寬度，並置中 --- */
body.desktop-admin .page > * {
  max-width: 1200px;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.desktop-admin .page-header,
body.desktop-admin [id^="page-admin"] > div,
body.desktop-admin [id^="page-store"] > div {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* --- 消費者首頁在電腦版：商品 4 欄， modal 寬度放寬 --- */
body.desktop-admin #page-home .product-grid {
  grid-template-columns: repeat(4, 1fr) !important;
}
body.desktop-admin .modal-box {
  max-width: 560px;
}

/* --- 表格：允許橫向捲動容器 --- */
body.desktop-admin tbody tr:hover td { background: #f7f9ff; }

/* --- 電腦版後台：分組總覽樣式 --- */
body.desktop-admin .da-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
body.desktop-admin .da-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* --- 頂部麵包屑 --- */
body.desktop-admin #da-breadcrumb {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 4px;
}
body.desktop-admin #da-breadcrumb i { font-size: 11px; color: var(--text-light); }
body.desktop-admin #da-breadcrumb span:last-child { color: var(--text); font-weight: 600; }

/* 漢堡選單在電腦版隱藏 */
body.desktop-admin #main-header .icon-btn:first-child { display: none !important; }

/* 電腦版隱藏 header logo（側欄已有 logo）*/
body.desktop-admin #da-logo-mobile { display: none !important; }

/* 電腦版顯示麵包屑 */
body.desktop-admin #da-breadcrumb { display: flex !important; }

/* 分隔線在深色側欄 */
body.desktop-admin .sidebar hr { border-color: var(--da-sidebar-border); }

/* 搜尋框深色主題 */
body.desktop-admin #admin-nav-search {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #e2e8f0 !important;
}
body.desktop-admin #admin-nav-search::placeholder { color: rgba(148,163,184,0.5); }
body.desktop-admin #admin-nav-search:focus {
  background: rgba(255,255,255,0.10) !important;
  border-color: rgba(255,107,53,0.5) !important;
  box-shadow: 0 0 0 2px rgba(255,107,53,0.15) !important;
}
body.desktop-admin #admin-nav-search + i { color: rgba(148,163,184,0.5) !important; }
body.desktop-admin [style*="fa-search"][style*="position:absolute"] { color: rgba(148,163,184,0.5) !important; }

/* --- 滾動條美化（側欄） --- */
body.desktop-admin .sidebar::-webkit-scrollbar { width: 4px; }
body.desktop-admin .sidebar::-webkit-scrollbar-track { background: transparent; }
body.desktop-admin .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
body.desktop-admin .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* --- 麵包屑預設隱藏 --- */
#da-breadcrumb { display: none; }

/* --- 切換按鈕本體 --- */
#btn-desktop-mode {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  background: transparent;
  transition: all .18s;
  width: 100%;
  margin-top: 8px;
  cursor: pointer;
}
#btn-desktop-mode:hover { background: var(--bg); }

/* ---- 訂單卡片 v2 ---- */
.oc2-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
  margin-bottom: 4px;
  overflow: hidden;
  position: relative;
}
.oc2-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; border-radius: 5px 0 0 5px;
  background: var(--gradient-primary);
}
.oc2-card[data-status="picked_up"]::before,
.oc2-card[data-status="cancelled"]::before { background: linear-gradient(180deg, #9ca3af, #6b7280); }
.oc2-card[data-status="arrived"]::before { background: linear-gradient(180deg, #34d399, #10b981); }
.oc2-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px 20px; border-bottom: 1px solid rgba(0,0,0,0.04);
  background: linear-gradient(90deg, rgba(241,245,249,0.95), rgba(255,255,255,0.95));
}
.oc2-status { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 20px; }
.oc2-status.s-pending { background: #fff8e7; color: #d97706; border: 1px solid rgba(217,119,6,.2); }
.oc2-status.s-active { background: #fff8e7; color: #d97706; border: 1px solid rgba(217,119,6,.2); }
.oc2-status.s-confirmed { background: #eff6ff; color: #2563eb; border: 1px solid rgba(37,99,235,.2); }
.oc2-status.s-shipping { background: #ecfeff; color: #0e7490; border: 1px solid rgba(14,116,144,.2); }
.oc2-status.s-arrived { background: #f0fdf4; color: #16a34a; border: 1px solid rgba(22,163,74,.2); }
.oc2-status.s-picked_up { background: #f4f4f5; color: #71717a; border: 1px solid rgba(0,0,0,.08); }
.oc2-status.s-cancelled { background: #fef2f2; color: #dc2626; border: 1px solid rgba(220,38,38,.2); }
.oc2-status.s-queued    { background: #fff7ed; color: #c2410c; border: 1px solid rgba(194,65,12,.2);  }
.oc2-status.s-abandoned { background: #fef2f2; color: #9ca3af; border: 1px solid rgba(0,0,0,.08);     }
.oc2-status.s-group_closed { background: #eef2ff; color: #4338ca; border: 1px solid rgba(67,56,202,.2); }
.oc2-body { padding: 12px 14px 12px 20px; }
.oc2-product-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.oc2-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--bg); }
.oc2-img-placeholder { width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.oc2-product-name { font-size: 15px; font-weight: 800; margin-bottom: 3px; }
.oc2-meta-chip { font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 2px 8px; border-radius: 8px; display: inline-block; margin-top: 2px; }
.oc2-spec-list {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.oc2-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  box-shadow: inset 3px 0 0 #fb923c;
}
.oc2-spec-row:nth-child(even) {
  background: #fffaf5;
}
.oc2-spec-name-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.oc2-spec-name {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  line-height: 1.35;
  word-break: break-word;
}
.oc2-spec-qty {
  font-size: 13px;
  font-weight: 900;
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.oc2-info-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); padding: 3px 0; }
.oc2-pickup-date {
  color: #dc2626;
  font-weight: 800;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 4px 0 2px;
}
.oc2-summary { margin-top: 2px; }
.oc2-footer { padding: 0; border-top: 1px solid rgba(0,0,0,0.04); background: rgba(255,107,53,0.02); }
.oc2-total { font-size: 18px; font-weight: 900; color: var(--primary); }
.oc2-count { font-size: 13px; color: var(--text-muted); }
.oc2-action { padding: 8px 14px 8px 20px; border-top: 1px solid rgba(0,0,0,0.04); }
.oc2-action-btn {
  width: 100%;
  border: none;
  border-radius: 0;
  padding: 12px 14px 12px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #1d4ed8;
  background: linear-gradient(90deg, #eff6ff, #e0e7ff);
  cursor: pointer;
  transition: all .18s;
}
.oc2-action-btn:hover {
  background: linear-gradient(90deg, #dbeafe, #c7d2fe);
}
.oc2-action-btn.is-pending {
  color: #92400e;
  background: #fef3c7;
  cursor: not-allowed;
}
.oc2-action-btn.is-closed {
  color: #4338ca;
  background: #eef2ff;
  cursor: not-allowed;
}
.oc2-action-btn.is-disabled {
  color: #6b7280;
  background: #f3f4f6;
  cursor: not-allowed;
}

/* ---- 購物車取貨日期 chip ---- */
.cart-pickup-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #fff0e8; color: var(--primary); border: 1px solid rgba(255,107,53,.25); display: inline-block; margin-top: 3px; }

/* ---- Cart v2 ---- */
.cart-product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.cart-product-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.cart-product-info { flex: 1; min-width: 0; }
.cart-product-subtotal { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.cart-img-placeholder {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg,#f5f5f5,#e9e9e9);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.cart-specs-body { padding: 0 14px 4px; }
.cart-spec-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  gap: 8px;
}
.cart-spec-name { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.cart-spec-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cart-pool-note {
  font-size: 11px; color: var(--text-muted);
  padding: 4px 0 2px; text-align: center;
}
.cart-group-price-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0 10px;
}
.cart-group-total { font-size: 16px; font-weight: 800; color: var(--primary); }
.cart-group-divider { height: 1px; background: var(--border); margin: 4px 0 8px; }

/* ---- Checkout v2 ---- */
.checkout-layout { padding: 16px; display: flex; flex-direction: column; gap: 0; }
.checkout-layout .card { margin-bottom: 16px; }
.checkout-layout .btn-primary.btn-lg { margin-bottom: 32px; }

/* ---- 訂單頁 Hero 在 page-header 下方不需 60px top padding ---- */
#order-hero-stats.order-search-hero { padding-top: 16px; }


/* ---- Admin Groupbuy Overview ---- */
.admin-gb-shell {
  padding: 0 16px 24px;
}

.admin-gb-head-note {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

.admin-gb-tabs {
  padding: 0 0 10px;
  gap: 6px;
}

.admin-gb-tabs .tab {
  border: 1px solid #dbe4f1;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.admin-gb-tabs .tab.active {
  border-color: #15803d;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.24);
}

.admin-gb-list {
  padding-bottom: 6px;
}

.admin-gb-tools {
  border: 1px solid #dbe4f1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 12px;
  margin-bottom: 10px;
}

.admin-gb-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.admin-gb-stat {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-gb-stat span {
  font-size: 11px;
  color: #64748b;
}

.admin-gb-stat b {
  font-size: 18px;
  line-height: 1.2;
  color: #0f172a;
}

.admin-gb-tool-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-gb-search-wrap {
  flex: 1;
  min-width: 240px;
}

.admin-gb-tool-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-gb-countline {
  font-size: 12px;
  color: #64748b;
  margin: 6px 2px 10px;
}

.admin-gb-countline b {
  color: #0f172a;
}

.admin-gb-list-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-gb-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  padding: 12px;
  margin-bottom: 0;
  position: relative;
}

.admin-gb-card.is-pinned {
  border-color: #f59e0b;
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.16);
}

.admin-gb-main {
  margin-bottom: 12px;
  align-items: flex-start;
}

.admin-gb-thumb {
  width: 86px;
  height: 86px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  background: #f8fafc;
}

.admin-gb-info {
  min-width: 0;
}

.admin-gb-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.admin-gb-topline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

.admin-gb-deadline-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid #dbe4f1;
  background: #f8fafc;
  color: #334155;
}

.admin-gb-deadline-chip.normal {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-gb-deadline-chip.warning {
  border-color: #fcd34d;
  background: #fef9c3;
  color: #a16207;
}

.admin-gb-deadline-chip.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.admin-gb-deadline-chip.muted {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #64748b;
}

.admin-gb-deadline-chip.none {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.admin-gb-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.admin-gb-meta-item {
  border: 1px solid #e8edf4;
  border-radius: 9px;
  background: #f8fbff;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.admin-gb-meta-item span {
  font-size: 11px;
  color: #64748b;
}

.admin-gb-meta-item b {
  font-size: 12px;
  color: #0f172a;
  font-weight: 800;
}

.admin-gb-actions {
  border-top: 1px solid #edf2f7;
  padding-top: 10px;
  gap: 6px;
}

.admin-gb-actions .btn {
  border-radius: 9px;
}

body.desktop-admin .admin-gb-shell {
  padding-left: 24px;
  padding-right: 24px;
}

body.desktop-admin .admin-gb-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.desktop-admin .admin-gb-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 820px) {
  .admin-gb-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .admin-gb-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-gb-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-gb-thumb {
    width: 72px;
    height: 72px;
  }
}


/* ---- Admin Cache Dashboard ---- */
.admin-cache-shell {
  padding: 0 16px 80px;
}

.admin-cache-hero {
  background: linear-gradient(130deg, #0f172a 0%, #1e3a8a 58%, #0369a1 100%);
  border-radius: 18px;
  padding: 16px;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.admin-cache-hero::after {
  content: '';
  position: absolute;
  right: -42px;
  top: -40px;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.admin-cache-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.admin-cache-hero-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
}

.admin-cache-hero-title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
  margin-top: 2px;
}

.admin-cache-hero-sub {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.9;
}

.admin-cache-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-cache-action-row .btn {
  font-size: 12px;
}

.admin-cache-action-row .btn-outline {
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-cache-action-row .btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.admin-cache-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
}

.admin-cache-stat {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
}

.admin-cache-stat-label {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.86;
}

.admin-cache-stat-value {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
  margin-top: 2px;
}

.admin-cache-stat-value-sm {
  font-size: 15px;
}

.admin-cache-stat-meta {
  font-size: 11px;
  opacity: 0.88;
  margin-top: 2px;
}

.admin-cache-section {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 14px;
  margin-bottom: 12px;
}

.admin-cache-section-head {
  margin-bottom: 10px;
}

.admin-cache-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-cache-section-title i {
  color: #1d4ed8;
}

.admin-cache-section-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.admin-cache-kv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-cache-kv-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 9px 10px;
}

.admin-cache-kv-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.admin-cache-kv-time {
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-cache-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.admin-cache-pill.sync {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.admin-cache-pill.pending {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.admin-cache-kv-age {
  font-size: 12px;
  white-space: nowrap;
  font-weight: 600;
}

.admin-cache-domain-block {
  margin-bottom: 10px;
}

.admin-cache-domain-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.admin-cache-domain-name {
  font-size: 13px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #0f172a;
}

.admin-cache-entry {
  border: 1px solid #e8edf4;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 10px;
  margin-bottom: 5px;
}

.admin-cache-entry-key {
  font-size: 12px;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-cache-entry-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.admin-cache-progress-wrap {
  height: 5px;
  background: #dbe4ee;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.admin-cache-progress-bar {
  height: 100%;
  border-radius: 999px;
}

.admin-cache-dirty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 9px 10px;
  margin-bottom: 5px;
}

.admin-cache-dirty-row i {
  font-size: 13px;
}

.admin-cache-dirty-row.is-active {
  border-color: #fdba74;
  background: #fff7ed;
}

.admin-cache-dirty-row.is-active i {
  color: #d97706;
}

.admin-cache-dirty-row.is-expired i {
  color: #22c55e;
}

.admin-cache-dirty-table {
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 800;
  color: #0f172a;
}

.admin-cache-dirty-text {
  margin-left: 8px;
  font-size: 12px;
  color: #64748b;
}

.admin-cache-table-wrap {
  overflow-x: auto;
}

.admin-cache-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-cache-table thead tr {
  border-bottom: 2px solid #e2e8f0;
}

.admin-cache-table tbody tr {
  border-bottom: 1px solid #edf2f7;
}

.admin-cache-table th,
.admin-cache-table td {
  padding: 7px 8px;
  text-align: left;
}

.admin-cache-table .tar {
  text-align: right;
}

.admin-cache-table td.domain {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 700;
}

.admin-cache-table td.hit {
  color: #15803d;
}

.admin-cache-table td.miss {
  color: #b91c1c;
}

.admin-cache-rate-track {
  width: 76px;
  height: 4px;
  margin-left: auto;
  margin-top: 4px;
  border-radius: 999px;
  background: #dbe4ee;
  overflow: hidden;
}

.admin-cache-rate-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.admin-cache-empty {
  border: 1px dashed #dbe4f1;
  border-radius: 10px;
  background: #f8fafc;
  padding: 16px 12px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

body.desktop-admin .admin-cache-shell {
  padding-left: 24px;
  padding-right: 24px;
}

body.desktop-admin .admin-cache-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 420px) {
  .admin-cache-summary-grid {
    grid-template-columns: 1fr;
  }

  .admin-cache-kv-row {
    grid-template-columns: 1fr;
  }

  .admin-cache-kv-age {
    justify-self: start;
  }
}


/* ---- Admin Cron Logs ---- */
.admin-cron-shell {
  padding: 0 16px 80px;
}

.admin-cron-hero {
  background: linear-gradient(130deg, #0f4c81 0%, #1d4ed8 60%, #3b82f6 100%);
  border-radius: 18px;
  padding: 16px;
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(29, 78, 216, 0.25);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.admin-cron-hero::after {
  content: '';
  position: absolute;
  right: -34px;
  top: -34px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.admin-cron-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.admin-cron-hero-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.85;
}

.admin-cron-hero-title {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.2px;
  line-height: 1.2;
  margin-top: 2px;
}

.admin-cron-hero-sub {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
}

.admin-cron-refresh {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(3px);
  font-size: 13px;
}

.admin-cron-refresh:hover {
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.admin-cron-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
}

.admin-cron-stat {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
}

.admin-cron-stat-label {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 600;
}

.admin-cron-stat-value {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
  margin-top: 2px;
}

.admin-cron-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-cron-filter-btn {
  border: 1px solid #dbe4f1;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.admin-cron-filter-btn.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-color: #1d4ed8;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

.admin-cron-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-cron-card {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.admin-cron-card-head {
  padding: 12px;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.admin-cron-runid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}

.admin-cron-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-cron-status {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
}

.admin-cron-status.success {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}

.admin-cron-status.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.admin-cron-status.unknown {
  background: #f1f5f9;
  color: #334155;
  border-color: #e2e8f0;
}

.admin-cron-meta-text {
  font-size: 11px;
  color: #64748b;
}

.admin-cron-card-body {
  padding: 12px;
}

.admin-cron-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.admin-cron-metric {
  border: 1px solid #e8edf4;
  background: #f8fbff;
  border-radius: 10px;
  padding: 8px;
}

.admin-cron-metric-label {
  font-size: 11px;
  color: #64748b;
}

.admin-cron-metric-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
}

.admin-cron-error-box {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  padding: 8px 10px;
}

.admin-cron-error-title {
  font-size: 11px;
  font-weight: 800;
  color: #b91c1c;
}

.admin-cron-error-msg {
  margin-top: 2px;
  font-size: 12px;
  color: #7f1d1d;
  line-height: 1.5;
}

.admin-cron-raw {
  margin-top: 10px;
}

.admin-cron-raw summary {
  cursor: pointer;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.admin-cron-raw pre {
  margin: 8px 0 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow: auto;
  font-size: 11px;
  color: #334155;
}

.admin-cron-empty {
  border: 1px dashed #dbe4f1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  text-align: center;
  padding: 18px 12px;
}

body.desktop-admin .admin-cron-shell {
  padding-left: 24px;
  padding-right: 24px;
}

body.desktop-admin .admin-cron-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.desktop-admin .admin-cron-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}



/* =============================================
   電腦版管理後台 (desktop-mode)
   ============================================= */

/* ── 版面變數 ── */
body.desktop-mode { --dsk-nav-w: 268px; }

/* ── #app 全寬 ── */
body.desktop-mode #app {
  max-width: none;
  box-shadow: none;
  background: var(--bg);
}

/* ── Sidebar：永久左側面板 ── */
body.desktop-mode .sidebar-overlay { display: none !important; }
body.desktop-mode .sidebar {
  left: 0 !important;
  transition: none;
  width: var(--dsk-nav-w);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 24px rgba(0,0,0,0.06);
  background: linear-gradient(180deg, #ffffff 0%, #f9faff 100%);
}
body.desktop-mode .sidebar-header .icon-btn { display: none !important; }
body.desktop-mode .sidebar-header {
  position: relative;
  background: linear-gradient(135deg, rgba(255,107,53,0.08) 0%, transparent 100%);
}
body.desktop-mode .sidebar-header::after {
  content: 'DESKTOP';
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(255,107,53,0.25);
  padding: 2px 7px; border-radius: 5px;
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
}

/* ── Header：從側欄右邊延伸 ── */
body.desktop-mode #main-header {
  left: var(--dsk-nav-w);
  transform: none;
  max-width: none;
  width: calc(100% - var(--dsk-nav-w));
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
body.desktop-mode #main-header .header-left > button:first-child { display: none !important; }

/* ── Main content：往右讓出側欄空間 ── */
body.desktop-mode #main-content {
  margin-left: var(--dsk-nav-w);
  max-width: none;
  padding-bottom: 56px;
}

/* ── 隱藏底部導覽列 ── */
body.desktop-mode #bottom-nav,
body.desktop-mode #bottom-nav-store { display: none !important; }

/* ── Page 進場動畫取消 ── */
body.desktop-mode .page.active { animation: none; }

/* ── Page Header sticky ── */
body.desktop-mode .page-header {
  padding: 20px 32px 14px;
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--bg-white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
body.desktop-mode .page-header h2 { font-size: 22px; letter-spacing: -0.01em; }

/* ── 統計卡片：4 欄 ── */
body.desktop-mode .stats-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
/* ── 管理雙欄 grid ── */
body.desktop-mode .admin-grid {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
body.desktop-mode #admin-pending-grid { grid-template-columns: repeat(4, 1fr); }
body.desktop-mode #admin-quick-actions-grid { grid-template-columns: repeat(6, 1fr); }

/* ── 卡片桌機微調 ── */
body.desktop-mode .card { border-radius: 14px; }
body.desktop-mode .stat-card { padding: 20px; }
body.desktop-mode .stat-value { font-size: 28px; }

/* ── 資料表格更舒適 ── */
body.desktop-mode .data-table th,
body.desktop-mode .data-table td { padding: 12px 16px; }
body.desktop-mode .data-table { font-size: 14px; }

/* ── 桌機模式切換按鈕 ── */
#desktop-mode-btn {
  font-size: 13px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all 0.2s ease;
}
#desktop-mode-btn:disabled { cursor: not-allowed; }

/* ---------- Global Marquee Bar ---------- */
#global-marquee-bar {
  display: none;                          /* JS 直接設 style.display = 'flex' 顯示，class 只是備援 */
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: 36px;
  z-index: 9999;                          /* 最頂層，確保蓋過 header/sidebar */
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#marquee-viewport {
  overflow: hidden;
  flex: 1;
  position: relative;
  height: 100%;
}
#global-marquee-text {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}
body.has-marquee #main-header  { top: 36px; }
body.has-marquee .sidebar       { top: 36px; }
body.has-marquee .sidebar-overlay { top: 36px; }
body.has-marquee #main-content  { padding-top: calc(var(--header-h) + 36px); }

/* ---------- Announcement Carousel ---------- */
.ann-section-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin: 10px 0 5px;
  padding-left: 2px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 5px;
}
.ann-dot-row { display: flex; justify-content: center; gap: 5px; margin: 3px 0 2px; }
.ann-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border);
  border: none; padding: 0; cursor: pointer;
  transition: background 0.2s;
}
.ann-dot.active { background: var(--primary); }
@keyframes annSlideIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ann-fade-in { animation: annSlideIn 0.3s ease both; }

/* 首頁公告卡固定高度（防止輪播時版面位移） */

/* ── 商品儲存預覽 Modal ── */
.preview-info-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.preview-info-table th,
.preview-info-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle; text-align: left;
}
.preview-info-table th {
  width: 90px; color: var(--text-muted); font-weight: 600;
  white-space: nowrap; background: var(--bg-soft);
}
.preview-schedule-table th { background: #f0f4ff; color: #3730a3; font-weight: 700; }
.preview-info-table tr:last-child td,
.preview-info-table tr:last-child th { border-bottom: none; }
.preview-section-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .5px; border-bottom: 2px solid var(--border);
  padding-bottom: 6px; margin: 16px 0 10px;
}
.preview-section-title:first-child { margin-top: 0; }
#home-announcements .announcement-card {
  height: 76px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#home-announcements .announcement-card:active {
  opacity: 0.75;
  transform: scale(0.99);
}
#home-announcements .ann-card-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
#home-announcements .ann-card-body {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 輪播區塊有滑動提示 */
.ann-swipe-hint {
  font-size: 10px;
  color: var(--text-light);
  text-align: center;
  margin-top: 1px;
  letter-spacing: 0.3px;
}


  text-align: center;
  margin-top: 1px;
  letter-spacing: 0.3px;
}

/* ===== Campaign Carousel (首頁廣告輪播) ===== */
#home-campaigns {
  padding: 12px 16px 0;
}
.camp-carousel-wrap {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  touch-action: pan-y;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.camp-carousel-track {
  width: 100%;
}
.camp-slide {
  width: 100%;
  display: block;
  position: relative;
}
.camp-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.camp-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  display: block;
  transition: transform 0.2s ease;
}
.camp-slide:active .camp-img-wrap img {
  transform: scale(0.98);
}
/* 右上角放大按鈕 */
.camp-zoom-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.camp-carousel-wrap:hover .camp-zoom-hint { opacity: 1; }
.camp-title {
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  backdrop-filter: blur(4px);
}
.camp-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.camp-cta:active { background: var(--primary-dark); }
/* 左右切換箭頭 */
.camp-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s;
}
.camp-arrow:hover { background: rgba(0,0,0,0.6); }
.camp-prev { left: 8px; }
.camp-next { right: 8px; }
/* 圓點 */
.camp-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
}
.camp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}
.camp-dot.active {
  background: #fff;
  width: 16px;
  border-radius: 3px;
}
/* 淡入動畫 */
@keyframes campFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.camp-fade {
  animation: campFadeIn 0.3s ease both;
}

/* ===== Tutorial Page ===== */
.tut-step-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 14px rgba(0,0,0,.07);
  border: 1px solid rgba(0,0,0,.05);
}
.tut-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.tut-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,#C24A1D,#9F3B14);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(255,107,53,.35);
}
.tut-step-title {
  font-size: 15px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.tut-step-sub {
  font-size: 11px;
  color: #666;
}
.tut-desc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 2px;
}
.tut-desc-item {
  font-size: 13px;
  color: #444;
  line-height: 1.5;
}
.tut-tag {
  display: inline-block;
  background: #fff0eb;
  color: #C24A1D;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 100px;
  margin-right: 6px;
  white-space: nowrap;
}

/* Mock UI inside tutorial */
.tut-mockup {
  background: #f8f8fa;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid #eaeaea;
  box-shadow: 0 4px 18px rgba(0,0,0,.09);
  font-family: 'Noto Sans TC', sans-serif;
}
.mock-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mock-logo {
  font-size: 13px;
  font-weight: 800;
  color: #C24A1D;
}
.mock-btn-sm {
  font-size: 11px;
  background: none;
  border: 1.5px solid #C24A1D;
  color: #C24A1D;
  padding: 3px 12px;
  border-radius: 100px;
  font-weight: 700;
}
.mock-auth-tabs {
  display: flex;
  border-bottom: 1.5px solid #eee;
  margin-bottom: 14px;
}
.mock-tab {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
}
.mock-tab.active {
  color: #C24A1D;
  border-bottom: 2px solid #C24A1D;
  font-weight: 800;
}
.mock-form-group {
  margin-bottom: 10px;
}
.mock-label {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  margin-bottom: 3px;
}
.mock-input {
  background: #f5f5f7;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: #777;
}
.mock-input.has-text {
  color: #222;
}
.mock-btn-primary {
  background: linear-gradient(135deg,#C24A1D,#9F3B14);
  color: #fff;
  border-radius: 14px;
  padding: 11px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255,107,53,.3);
}
.mock-btn-white-sm {
  background: #fff;
  color: #C24A1D;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
}
.mock-product-card {
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.mock-product-img {
  font-size: 28px;
  text-align: center;
  padding: 8px 0 4px;
}
.mock-product-name {
  font-size: 10px;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
}
.mock-product-price {
  font-size: 11px;
  color: #C24A1D;
  font-weight: 800;
  margin-bottom: 2px;
}
.mock-deadline {
  font-size: 9px;
  color: #666;
}
.mock-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #444;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.mock-info-row {
  background: #f5f5f7;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 10px;
}
.mock-info-label {
  color: #666;
  display: block;
  margin-bottom: 1px;
}
.mock-info-val {
  color: #222;
  font-weight: 700;
}
.mock-order-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #eee;
  padding: 10px;
  margin-bottom: 8px;
}

/* ---------- Task Submit Modal ---------- */
#task-submit-modal .modal-box {
  border: 1px solid #c7d2fe;
  box-shadow: 0 20px 50px rgba(30, 41, 59, 0.2);
  overflow: hidden;
}

#task-submit-modal .modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  color: #fff;
  border-bottom: none;
}

#task-submit-modal .modal-header h3 {
  color: #fff;
  letter-spacing: 0.03em;
}

#task-submit-modal .modal-header .icon-btn {
  color: #dbeafe;
}

#task-submit-modal .modal-header .icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

#task-submit-modal .modal-body {
  background: linear-gradient(180deg, #f8fbff 0%, #fefefe 100%);
}

#tsm-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tsm-section-wrap {
  background: #ffffff;
  border: 1px solid #dbe7ff;
  border-radius: 14px;
  padding: 11px;
}

.tsm-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #1e3a8a;
}

.tsm-required {
  color: #dc2626;
}

.tsm-section-note {
  font-size: 12px;
  color: #334155;
  margin-top: 6px;
  margin-bottom: 9px;
  line-height: 1.7;
  background: linear-gradient(145deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px;
}

.tsm-note-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #1d4ed8;
}

.tsm-note-line {
  margin-top: 5px;
}

.tsm-tip-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.tsm-tip-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #075985;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
}

.tsm-lock-banner {
  font-size: 12px;
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.tsm-items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: tsmRow;
}

.tsm-item-row {
  position: relative;
  counter-increment: tsmRow;
  padding: 11px;
  border: 1.5px solid #bfdbfe;
  border-left-width: 5px;
  border-left-color: #2563eb;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.tsm-item-row::before {
  content: "品項 " counter(tsmRow);
  position: absolute;
  top: -9px;
  left: 10px;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 800;
  color: #1e3a8a;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

.tsm-item-row:nth-child(even) {
  border-left-color: #0891b2;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.tsm-item-row[data-preset="1"] {
  border-left-color: #dc2626;
  background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
}

.tsm-item-row[data-preset="1"]::before {
  content: "固定品項 " counter(tsmRow);
  color: #fff;
  background: #dc2626;
  border-color: #f87171;
}

.tsm-item-collapse {
  margin: 0;
}

.tsm-item-collapse-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  padding: 1px 0 6px;
}

.tsm-item-collapse-summary::-webkit-details-marker {
  display: none;
}

.tsm-item-collapse-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: #1e3a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsm-item-collapse-meta {
  flex-shrink: 0;
  font-size: 11px;
  color: #334155;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
}

.tsm-item-collapse-summary::after {
  content: "展開";
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 2px 8px;
}

.tsm-item-collapse[open] > .tsm-item-collapse-summary::after {
  content: "收合";
}

.tsm-item-collapse-body {
  padding-top: 2px;
}

.tsm-item-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-top: 8px;
}

.tsm-item-code-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.tsm-item-top-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-shrink: 0;
}

.tsm-item-code-top span {
  font-size: 10px;
  color: #111111;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.tsm-item-code-top .tsm-item-code {
  font-size: 11px;
  font-weight: 800;
  height: 28px;
  padding: 4px 8px;
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #111111;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.tsm-item-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #92400e;
  background: #ffedd5;
  border: 1px solid #fdba74;
  flex-shrink: 0;
}

.tsm-item-tag-custom {
  color: #0f766e;
  background: #ecfeff;
  border-color: #99f6e4;
}

.tsm-field-label {
  font-size: 12px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 4px;
}

.tsm-field-block {
  margin-bottom: 6px;
}

.tsm-inline-grid {
  display: grid;
  gap: 6px;
  align-items: start;
}

.tsm-inline-field {
  min-width: 0;
  border-radius: 11px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.tsm-inline-field-expiry .tsm-expiry-picker {
  width: 100%;
  min-width: 0;
}

.tsm-expiry-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tsm-expiry-picker-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.tsm-expiry-picker-row .form-control {
  min-width: 0;
  width: 100%;
  font-size: 12px;
  padding-left: 7px;
  padding-right: 4px;
}

.tsm-expiry-picker.tsm-expiry-partial .form-control {
  border-color: #f59e0b;
  background: #fff7ed;
}

.tsm-inline-field-expiry {
  background: #fff7ed;
  border-color: #fdba74;
}

.tsm-inline-field-qty {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: #eff6ff;
  border-color: #93c5fd;
}

.tsm-inline-field-qty .tsm-inline-label {
  width: 100%;
  text-align: right;
}

.tsm-inline-field-qty .tsm-item-qty {
  width: 100%;
  max-width: 108px;
}

.tsm-inline-label {
  font-size: 11px;
  color: #334155;
  font-weight: 800;
  margin-bottom: 3px;
}

.tsm-row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  height: 35px;
  border-radius: 10px;
}

.tsm-item-top-actions .tsm-row-remove {
  align-self: auto;
  height: 28px;
  min-width: 34px;
  padding: 0 8px;
}

.tsm-text-block {
  margin-top: 6px;
}

.tsm-item-photo-wrap {
  margin-top: 6px;
}

.tsm-photo-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1.5px dashed #93c5fd;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #1e40af;
}

.tsm-photo-empty {
  font-size: 12px;
  color: #334155;
  padding: 4px 0;
}

.tsm-photo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tsm-photos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  padding: 4px 0;
  margin-bottom: 8px;
}

.tsm-photo-card {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.tsm-photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.tsm-field-group .form-control {
  border-width: 1.5px;
  background: #ffffff;
  border-color: #d1d5db;
}

.tsm-item-row .form-control {
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  border-width: 1.5px;
}

.tsm-item-text {
  min-height: 34px;
  line-height: 1.35;
  resize: vertical;
}

.tsm-item-name-fixed {
  line-height: 1.45;
  font-weight: 800;
  white-space: normal;
  word-break: break-word;
  min-height: 34px;
  display: flex;
  align-items: center;
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #111111;
}

.tsm-item-row .tsm-item-name {
  color: #111111;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tsm-item-name-edit {
  color: #111111;
  font-weight: 800;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
}

.tsm-item-name-edit,
.tsm-item-text {
  background: #ffffff;
  border-color: #d1d5db;
}

.tsm-expiry-picker .form-control {
  background: #ffffff;
  border-color: #d1d5db;
}

.tsm-item-qty {
  background: #ffffff;
  border-color: #d1d5db;
  text-align: center;
}

.tsm-item-name-edit.tsm-input-filled,
.tsm-item-text.tsm-input-filled,
#tsm-text.tsm-input-filled {
  background: #ecfdf3;
  border-color: #86efac;
}

.tsm-item-qty.tsm-input-filled,
#tsm-number.tsm-input-filled {
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.tsm-expiry-picker.tsm-input-filled .form-control {
  background: #fff1e8;
  border-color: #fdba74;
}

.tsm-item-name-edit:focus,
.tsm-item-text:focus,
#tsm-text:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.tsm-item-qty:focus,
#tsm-number:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.tsm-expiry-picker .form-control:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.tsm-single-note {
  margin-bottom: 2px;
}

.tsm-field-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 0;
}

.tsm-field-group-text {
  border-left-color: #16a34a;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.tsm-field-group-number {
  border-left-color: #0284c7;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.tsm-field-group-expiry {
  border-left-color: #ea580c;
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.tsm-field-group-photo {
  border-left-color: #0f766e;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.tsm-field-subhint {
  font-size: 11px;
  color: #64748b;
  margin-left: 4px;
}

.tsm-add-item-btn {
  border-style: dashed;
  border-width: 2px;
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.tsm-add-item-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

@media (max-width: 560px) {
  /* 手機顯示大小設為「大」時，保護欄位不錯位 */
  #task-submit-modal .modal-body {
    padding: 12px;
  }

  .tsm-section-wrap {
    padding: 9px;
  }

  .tsm-item-row {
    padding: 8px;
  }

  .tsm-item-row::before {
    left: 8px;
  }

  .tsm-item-code-top {
    width: 100%;
  }

  .tsm-item-code-top .tsm-item-code {
    width: 100%;
    max-width: 100%;
  }

  .tsm-expiry-picker-row {
    gap: 5px;
  }

  .tsm-inline-field-qty .tsm-item-qty {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .tsm-item-top {
    flex-direction: row;
    align-items: flex-end;
    gap: 4px;
  }

  .tsm-item-tag {
    align-self: flex-start;
  }

  .tsm-inline-grid {
    grid-template-columns: 1fr !important;
  }

  .tsm-inline-field-qty,
  .tsm-inline-field-qty .tsm-inline-label {
    align-items: flex-start;
    text-align: left;
  }

  .tsm-inline-field-qty .tsm-item-qty {
    max-width: 100%;
  }

  .tsm-item-top-actions .tsm-row-remove {
    width: 34px;
  }
}

/* ---------- Task Admin Preset Items ---------- */
.tm-preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 120px 38px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.tm-preset-row .tm-preset-name {
  min-width: 0;
}

.tm-preset-row .tm-preset-code,
.tm-preset-row .tm-preset-expiry {
  min-width: 0;
  text-align: center;
}

@media (max-width: 560px) {
  .tm-preset-row {
    grid-template-columns: minmax(0, 1fr) 82px 106px 34px;
    gap: 5px;
  }

  .tm-preset-row .form-control {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* ---------- Expiry Management Hub ---------- */
.expiry-page-wrap {
  position: relative;
  padding: 0 16px 18px;
}

.expiry-page-wrap::before {
  content: '';
  position: absolute;
  inset: 4px 14px auto;
  height: 180px;
  background:
    radial-gradient(circle at 10% 20%, rgba(251, 191, 36, 0.25), transparent 38%),
    radial-gradient(circle at 85% 0%, rgba(14, 165, 233, 0.2), transparent 44%),
    linear-gradient(135deg, rgba(255, 237, 213, 0.88), rgba(255, 255, 255, 0));
  border-radius: 18px;
  pointer-events: none;
  z-index: 0;
}

.expiry-page-wrap > * {
  position: relative;
  z-index: 1;
}

.expiry-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: linear-gradient(115deg, #fff7ed 0%, #f0f9ff 100%);
  box-shadow: 0 10px 24px rgba(148, 85, 16, 0.12);
  margin-bottom: 14px;
  animation: expiryFadeIn 280ms ease-out;
}

.expiry-hero h3 {
  margin: 0 0 6px;
  color: #9a3412;
  font-size: 17px;
  line-height: 1.35;
}

.expiry-hero p {
  margin: 0;
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.75;
}

.expiry-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.expiry-hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
}

.expiry-panel {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.expiry-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: #9a3412;
  font-size: 13px;
  font-weight: 800;
}

.expiry-section-title small {
  font-size: 11px;
  font-weight: 600;
  color: #78716c;
}

.expiry-field-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}

.expiry-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.expiry-grid-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.expiry-task-picker {
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: #fffbeb;
}

.expiry-log-wrap {
  margin-top: 10px;
  border-top: 1px dashed #fdba74;
  padding-top: 8px;
}

.expiry-log-list {
  max-height: 160px;
  overflow: auto;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 9px;
  padding: 8px;
}

.ai-inbound-log-row {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.ai-inbound-log-row:last-child {
  border-bottom: 0;
}

.ai-inbound-log-row.editing {
  padding: 8px;
  border: 1px solid #fdba74;
  border-radius: 9px;
  background: #fff7ed;
}

.expiry-result-summary {
  padding: 9px 10px;
  border: 1px solid #fed7aa;
  background: linear-gradient(135deg, #fff7ed, #fefce8);
  border-radius: 10px;
  font-size: 12px;
  color: #9a3412;
}

.expiry-task-create-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.expiry-pending-list {
  display: grid;
  gap: 8px;
}

.expiry-pending-row {
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 8px;
  background: #fef2f2;
}

.expiry-pending-row.status-done {
  border-color: #86efac;
  background: #ecfdf5;
}

.expiry-pending-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.expiry-pending-pick {
  padding-top: 4px;
}

.expiry-pending-status-btn {
  min-width: 76px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.expiry-pending-row.status-done .expiry-pending-status-btn {
  border-color: #4ade80;
  background: #dcfce7;
  color: #166534;
}

.expiry-pending-main {
  min-width: 0;
  flex: 1;
}

.expiry-pending-title {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.expiry-pending-meta {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 2px;
}

.expiry-task-input {
  min-height: 70px;
  line-height: 1.5;
  resize: vertical;
}

.expiry-task-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
}

.expiry-submit-btn {
  height: 38px;
}

.ai-inbound-item-row {
  border: 1px solid #fde68a;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
}

.ai-inbound-row-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.ai-inbound-row-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
}

.ai-inbound-field {
  min-width: 0;
}

.ai-inbound-field-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 4px;
}

.ai-inbound-qty-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-inbound-code-field {
  position: relative;
}

.ai-inbound-code-suggest {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #fdba74;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(194, 65, 12, 0.18);
  max-height: 210px;
  overflow: auto;
}

.ai-inbound-suggest-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed #fed7aa;
}

.ai-inbound-suggest-item:last-child {
  border-bottom: 0;
}

.ai-inbound-suggest-item .code {
  font-size: 11px;
  color: #b45309;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ai-inbound-suggest-item .name {
  font-size: 12px;
  color: #1f2937;
  font-weight: 700;
}

.ai-inbound-remove-below {
  height: 32px;
  width: 100%;
  padding: 0 8px;
}

.ai-export-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.ai-export-action-btn {
  flex: 1 1 0;
  min-height: 46px;
  font-size: 16px;
  font-weight: 800;
  justify-content: center;
}

@keyframes expiryFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .expiry-hero {
    grid-template-columns: 1fr;
  }

  .expiry-hero-badges {
    justify-content: flex-start;
  }

  .expiry-grid-2col,
  .expiry-task-create-grid {
    grid-template-columns: 1fr;
  }

  .expiry-task-action-row {
    grid-template-columns: 1fr;
  }

  .expiry-submit-btn {
    width: 100%;
  }

  .expiry-form-grid {
    grid-template-columns: 1fr;
  }

  .ai-inbound-row-top,
  .ai-inbound-row-bottom {
    grid-template-columns: 1fr;
  }

  .ai-inbound-remove-below {
    width: 100%;
  }

  .ai-export-actions-row {
    flex-direction: row;
  }
}

.store-wish-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.store-wish-hero,
.store-wish-panel,
.store-wish-card,
.store-wish-stat {
  border-radius: 18px;
  border: 1px solid #dbe7f3;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.store-wish-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, .9fr);
  gap: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 52%, #eff6ff 100%);
}

.store-wish-kicker {
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.store-wish-hero h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.3;
}

.store-wish-hero p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.8;
}

.store-wish-hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.store-wish-scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #99f6e4;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 14px;
}

.store-wish-scope-badge.is-all {
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.store-wish-hero-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.store-wish-toolbar {
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.store-wish-search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.store-wish-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.store-wish-search-wrap input {
  padding-left: 38px;
}

.store-wish-toolbar-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 8px 12px;
}

.store-wish-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.store-wish-stat {
  padding: 14px;
  background: #fff;
}

.store-wish-stat .label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.store-wish-stat .value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}

.store-wish-stat .hint {
  font-size: 12px;
  color: #64748b;
}

.store-wish-stat.is-pending {
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.store-wish-stat.is-pending .label,
.store-wish-stat.is-pending .value {
  color: #c2410c;
}

.store-wish-stat.is-notified {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.store-wish-stat.is-notified .label,
.store-wish-stat.is-notified .value {
  color: #1d4ed8;
}

.store-wish-stat.is-closed {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.store-wish-stat.is-closed .label,
.store-wish-stat.is-closed .value {
  color: #475569;
}

.store-wish-stat.is-linked {
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
}

.store-wish-stat.is-linked .label,
.store-wish-stat.is-linked .value {
  color: #047857;
}

.store-wish-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.store-wish-card {
  padding: 16px;
  background: #ffffff;
}

.store-wish-card.is-closed {
  opacity: 0.82;
}

.store-wish-card.is-expanded {
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.store-wish-card-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.store-wish-card-summary-main {
  min-width: 0;
  flex: 1;
}

.store-wish-card-summary-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.store-wish-card-selected-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  background: #dbeafe;
  color: #1d4ed8;
}

.store-wish-expand-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.store-wish-card-body {
  margin-top: 12px;
}

.store-wish-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.store-wish-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.store-wish-card-title-row h3 {
  margin: 0;
  font-size: 19px;
  color: #0f172a;
}

.store-wish-title-code {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.store-wish-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
}

.store-wish-card-badge.is-linked {
  background: #ecfeff;
  color: #0f766e;
}

.store-wish-card-badge.is-manual {
  background: #fff7ed;
  color: #c2410c;
}

.store-wish-card-subline,
.store-wish-audit-row,
.store-wish-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-wish-card-subline,
.store-wish-item-meta,
.store-wish-audit-row {
  color: #64748b;
  font-size: 12px;
}

.store-wish-card-subline span,
.store-wish-item-meta span,
.store-wish-audit-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.store-wish-card-head-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.store-wish-chip-row {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.store-wish-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.store-wish-chip.is-pending {
  color: #c2410c;
  background: #ffedd5;
}

.store-wish-chip.is-notified {
  color: #1d4ed8;
  background: #dbeafe;
}

.store-wish-chip.is-closed {
  color: #475569;
  background: #e2e8f0;
}

.store-wish-card-tools {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.store-wish-inline-select {
  min-width: 150px;
}

.store-wish-inline-select.is-short {
  min-width: 118px;
  width: 118px;
}

.store-wish-add-btn {
  margin-left: auto;
  white-space: nowrap;
}

.store-wish-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(90deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.store-wish-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}

.store-wish-batch-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.store-wish-batch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.store-wish-batch-actions .btn {
  white-space: nowrap;
}

.store-wish-selected-count {
  font-size: 12px;
  color: #475569;
}

.store-wish-danger-btn {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.store-wish-item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-wish-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 14px;
}

.store-wish-item.status-pending {
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}

.store-wish-item.status-notified {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.store-wish-item.status-closed {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.store-wish-item-check {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
}

.store-wish-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.store-wish-item-mainline {
  min-width: 0;
  flex: 1;
}

.store-wish-item-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.store-wish-item-name-row strong {
  font-size: 16px;
  color: #0f172a;
}

.store-wish-item-note-inline {
  margin-top: 6px;
  font-size: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  word-break: break-word;
  color: #dc2626;
}

.store-wish-item-note-label,
.store-wish-item-note-value {
  color: #dc2626;
}

.store-wish-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
}

.store-wish-status-pill.pending {
  color: #c2410c;
  background: #ffedd5;
}

.store-wish-status-pill.notified {
  color: #1d4ed8;
  background: #dbeafe;
}

.store-wish-status-pill.closed {
  color: #475569;
  background: #e2e8f0;
}

.store-wish-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.store-wish-note-box {
  border-radius: 14px;
  padding: 10px 12px;
}

.store-wish-note-box.is-contact {
  background: #ecfeff;
  border: 1px solid #bae6fd;
}

.store-wish-note-box.is-note {
  background: #fefce8;
  border: 1px solid #fde68a;
}

.store-wish-note-box .label {
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 6px;
}

.store-wish-note-box .value {
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.store-wish-empty-card,
.store-wish-empty-shell {
  border-radius: 16px;
}

.store-wish-empty-card {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  text-align: center;
  padding: 20px 14px;
}

.store-wish-modal-grid {
  display: grid;
  gap: 12px;
}

.store-wish-modal-section {
  border-radius: 16px;
  padding: 14px;
}

.store-wish-modal-section.is-store {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.store-wish-modal-section.is-customer {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.store-wish-modal-section.is-product {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.store-wish-modal-section.is-status {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.store-wish-modal-section-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.store-wish-store-fixed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #86efac;
  color: #166534;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 13px;
}

.store-wish-product-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.store-wish-product-mode-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.store-wish-bind-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid #fdba74;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
}

.store-wish-bind-main {
  min-width: 0;
  flex: 1;
}

.store-wish-bind-title {
  font-size: 12px;
  font-weight: 800;
  color: #9a3412;
  margin-bottom: 3px;
}

.store-wish-bind-meta {
  font-size: 12px;
  color: #7c2d12;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-wish-bind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.store-wish-bind-qty {
  width: 132px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-wish-bind-qty-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
  line-height: 1.3;
}

.store-wish-product-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #fed7aa;
  background: rgba(255, 255, 255, 0.88);
  padding: 9px 11px;
  color: #9a3412;
  cursor: pointer;
}

.store-wish-product-option strong {
  font-size: 13px;
}

.store-wish-product-option span,
.store-wish-product-hint,
.store-wish-modal-tip {
  font-size: 12px;
  line-height: 1.7;
}

.store-wish-product-hint {
  color: #78716c;
  padding: 2px 2px 4px;
}

.store-wish-modal-tip {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

@media (max-width: 960px) {
  .store-wish-hero,
  .store-wish-card-head,
  .store-wish-summary-grid,
  .store-wish-note-grid {
    grid-template-columns: 1fr;
  }

  .store-wish-scope-badge,
  .store-wish-hero-buttons,
  .store-wish-chip-row,
  .store-wish-card-tools {
    justify-content: flex-start;
    align-self: flex-start;
  }

  .store-wish-card-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .store-wish-card-summary-side {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .store-wish-hero,
  .store-wish-panel,
  .store-wish-card {
    padding: 14px;
  }

  .store-wish-bind-card {
    flex-direction: column;
    align-items: stretch;
  }

  .store-wish-product-mode-actions .btn,
  .store-wish-bind-actions .btn {
    width: 100%;
  }

  .store-wish-bind-qty {
    width: 100%;
  }

  .store-wish-bind-qty-label {
    margin-top: 2px;
  }

  .store-wish-batch-bar,
  .store-wish-item-top {
    flex-direction: column;
    align-items: stretch;
  }

  .store-wish-card-tools .btn,
  .store-wish-card-tools select {
    width: 100%;
  }

  .store-wish-batch-actions {
    justify-content: flex-start;
  }

  .store-wish-add-btn {
    margin-left: 0;
  }

  .store-wish-item {
    grid-template-columns: 1fr;
  }

  .store-wish-item-check {
    justify-content: flex-start;
    padding-top: 0;
  }
}
