/* ═══════════════════════════════════════════════
   LAPGO × FUTURE STARS — Admin 後台共用樣式
   Layout: 深色左側欄 + 淺色右側內容
═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&family=cwTeX+Yen&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20,300,0,0&display=block');

/* Material Symbols */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: -5px;
  user-select: none;
}

.nav-icon .material-symbols-outlined {
  font-size: 22px;
  vertical-align: -4px;
}

:root {
  /* LAPGO 品牌色 */
  --yellow:       #FFD268;
  --yellow-deep:  #F7BD36;
  --yellow-bg:    #FFF8E8;
  --yellow-dim:   rgba(255, 210, 104, 0.14);
  --olive:        #50503F;
  --olive-dark:   #28281e;   /* sidebar 背景 */
  --olive-mid:    #38382c;   /* sidebar hover */
  --hint:         #7A7A60;
  --border:       #E8E8DC;
  --bg:           #F4F3EE;   /* 內容區底色 */
  --white:        #ffffff;
  --success:      #2DB56A;
  --success-bg:   #d1fae5;
  --success-text: #065f46;
  --danger:       #E84040;
  --danger-bg:    #fee2e2;
  --danger-text:  #b91c1c;
  --info-bg:      #e0f2fe;
  --info-text:    #0c4a6e;

  /* Layout */
  --sidebar-w:   230px;
  --topbar-h:    56px;
  --radius:      10px;
  --card-shadow: 0 1px 6px rgba(0,0,0,0.08);
  --font:        'cwTeX Yen', 'Noto Sans TC', 'PingFang TC', '微軟正黑體', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--olive);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ═══ LAYOUT ═══ */

.admin-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── 側邊欄 ── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--olive-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  transition: transform 0.25s ease;
}

/* Logo 區 */
.sidebar-logo {
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.sidebar-logo-img {
  width: 120px;
  height: auto;
}

.sidebar-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}

/* 導航 */
.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 14px 18px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  width: 100%;
  text-align: left;
  transition: background 0.14s, color 0.14s;
  border-radius: 0;
  font-family: var(--font);
}

.nav-item:hover {
  background: var(--olive-mid);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: var(--yellow-dim);
  color: var(--yellow);
  border-left-color: var(--yellow);
  font-weight: 600;
}

.nav-icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  font-size: 18px;
  opacity: 0.9;
}

.nav-item.active .nav-icon { opacity: 1; }

/* 底部（返回前台 / 登出） */
.sidebar-footer {
  padding: 8px 0 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-item-danger {
  color: rgba(232, 100, 100, 0.75);
}

.nav-item-danger:hover {
  background: rgba(232,64,64,0.12);
  color: #ff9090;
}

/* 手機 overlay */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}

.admin-overlay.show { display: block; }

/* ── 主內容 ── */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 頂部欄 */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--olive);
  font-size: 18px;
  border-radius: 6px;
  transition: background 0.14s;
}

.topbar-menu-btn:hover { background: var(--bg); }

.topbar-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--olive);
}

.topbar-spacer { flex: 1; }

.topbar-event-badge {
  font-size: 13px;
  font-weight: 600;
  background: var(--yellow);
  color: var(--olive-dark);
  padding: 4px 13px;
  border-radius: 20px;
}

.topbar-user {
  font-size: 14px;
  color: var(--hint);
}

/* 內容區 */
.admin-content {
  flex: 1;
  padding: 28px 28px 40px;
  overflow-y: auto;
}

/* ═══ 通用元件 ═══ */

/* 頁面標題 */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head-left h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--olive);
  line-height: 1.2;
}

.page-head-left p {
  font-size: 14px;
  color: var(--hint);
  margin-top: 4px;
}

/* ── 統計卡 ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.stat-label {
  font-size: 15px;
  color: var(--hint);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--olive);
  line-height: 1;
}

.stat-sub {
  font-size: 13px;
  color: var(--hint);
  margin-top: 6px;
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--olive);
}

.card-body { padding: 20px; }

/* ── Filter tabs（膠囊型） ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--hint);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.14s;
}

.filter-tab:hover {
  border-color: var(--yellow);
  color: var(--olive);
}

.filter-tab.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--olive-dark);
  font-weight: 600;
}

/* ── 搜尋框 ── */
.search-box {
  position: relative;
  flex: 1;
  min-width: 160px;
  max-width: 320px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 9px;
  display: flex;
  align-items: center;
  pointer-events: none;
  color: var(--hint);
  z-index: 2;
}

.search-icon .material-symbols-outlined {
  font-size: 18px;
  vertical-align: 0;
}

/* 用 input[type] 提高 specificity，確保蓋過全域 input[type="text"] 的 padding */
.search-box input[type="text"],
.search-box input[type="search"] {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--olive);
  background: var(--bg);
  outline: none;
  transition: border-color 0.14s;
}

.search-box input:focus {
  border-color: var(--yellow);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,210,104,0.2);
}

/* ── Table ── */
.table-wrap { overflow-x: auto; }

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

th {
  text-align: left;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
  background: #fafaf7;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--olive);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--yellow-bg); }

.td-main { font-weight: 500; }
.td-sub  { font-size: 13px; color: var(--hint); margin-top: 2px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.14s;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--yellow);
  color: var(--olive-dark);
  font-weight: 600;
}

.btn-primary:hover { background: var(--yellow-deep); }

.btn-outline {
  background: transparent;
  color: var(--olive);
  border: 1.5px solid var(--border);
}

.btn-outline:hover { background: var(--yellow-bg); border-color: var(--yellow); }

.btn-outline-green {
  background: transparent;
  color: var(--success);
  border: 1.5px solid #a7f3d0;
}

.btn-outline-green:hover { background: var(--success-bg); }

.btn-outline-blue {
  background: transparent;
  color: #0369a1;
  border: 1.5px solid #bae6fd;
}

.btn-outline-blue:hover { background: var(--info-bg); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid #fca5a5;
}

.btn-danger:hover { background: var(--danger-bg); }

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

.btn-actions { display: flex; gap: 6px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  line-height: 1.6;
}

.badge-yellow  { background: var(--yellow);      color: var(--olive-dark); }
.badge-green   { background: var(--success-bg);  color: var(--success-text); }
.badge-gray    { background: #f0efe8;             color: var(--hint); }
.badge-red     { background: var(--danger-bg);   color: var(--danger-text); }
.badge-olive   { background: rgba(80,80,63,0.12); color: var(--olive); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--olive);
  margin-bottom: 5px;
}

.form-input,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--olive);
  background: var(--white);
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255,210,104,0.22);
}

.form-hint {
  font-size: 13px;
  color: var(--hint);
  margin-top: 4px;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  background: var(--white);
  border-radius: 14px;
  padding: 28px 24px 22px;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--olive);
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--hint);
}

.empty-state .empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  font-size: 15px;
  line-height: 1.7;
}

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14.5px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}

.alert-warn { background: var(--yellow-bg); color: var(--olive); border: 1px solid var(--yellow); }
.alert-info { background: var(--info-bg); color: var(--info-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--danger-bg); color: var(--danger-text); }

/* ── Inline code ── */
code {
  font-size: 12px;
  background: #f0efe8;
  color: var(--olive);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Menlo', 'Monaco', monospace;
}

/* ── Page Footer ── */
.admin-page-footer {
  padding: 18px 28px;
  font-size: 11.5px;
  color: var(--hint);
  text-align: center;
  letter-spacing: 0.03em;
  margin-top: auto;
}

/* ── Dashboard — 快捷連結 ── */
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  text-decoration: none;
  color: var(--olive);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.14s;
}
.quick-link:hover { border-color: var(--yellow); background: var(--yellow-bg); }
.ql-icon { font-size: 26px; line-height: 1; color: var(--olive); }
.ql-icon .material-symbols-outlined { font-size: 26px; vertical-align: 0; }

/* ── 場次管理 — 發佈/草稿 Radio ── */
.radio-group { display: flex; gap: 12px; }
.radio-item {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.radio-item:has(input:checked) { border-color: var(--yellow); background: var(--yellow-bg); }
.radio-item input[type="radio"] { width: auto; margin-top: 3px; accent-color: var(--yellow-deep); flex-shrink: 0; }
.radio-item-body { line-height: 1.3; }
.radio-label { font-size: 14px; font-weight: 600; color: var(--olive); }
.radio-hint  { font-size: 12px; color: var(--hint); margin-top: 2px; }

/* ── 場次管理 — 顏色 & 圖片上傳 ── */
.bg-row { display: flex; gap: 8px; align-items: center; }
.bg-row input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  background: none;
}
.bg-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.bg-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }
.bg-row input[type="color"]::-moz-color-swatch { border: none; border-radius: 6px; }
.bg-row input[type="text"] { flex: 1; }

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  color: var(--hint);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s;
  width: 100%;
  margin-top: 8px;
}
.upload-label:hover { border-color: var(--yellow); color: var(--olive); }
.upload-label .material-symbols-outlined { font-size: 18px; vertical-align: -2px; }
.upload-filename { font-size: 13px; color: var(--hint); margin-top: 4px; }

/* ── 場次管理 — 入口 QR ── */
.entry-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0 4px;
}
.entry-qr-canvas-wrap {
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 2px solid var(--yellow);
  display: inline-block;
}
.entry-event-name { font-size: 16px; font-weight: 700; color: var(--olive); text-align: center; }
.entry-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.entry-url-text {
  flex: 1;
  font-size: 13px;
  color: var(--hint);
  word-break: break-all;
  font-family: 'Menlo', 'Monaco', monospace;
}
.copy-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--hint);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.14s;
}
.copy-btn:hover { color: var(--olive); }
.copy-btn .material-symbols-outlined { font-size: 20px; vertical-align: 0; }
.entry-qr-hint { font-size: 13px; color: var(--hint); text-align: center; line-height: 1.6; }

/* ── QR Code 產生 ── */
.gen-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.gen-row .field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; }
.gen-row select { height: 44px; font-size: 15px; }
.gen-row .btn { height: 44px; white-space: nowrap; flex-shrink: 0; }
.qr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.qr-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.qr-box {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-box .material-symbols-outlined { font-size: 52px; color: rgba(80,80,63,0.18); }
.qr-item-label { font-size: 15px; font-weight: 600; color: var(--olive); }
.qr-item-sub   { font-size: 13px; color: var(--hint); }

/* ── 獎品庫存 ── */
.prize-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  padding: 28px 24px;
  margin-bottom: 20px;
  max-width: 480px;
}
.prize-name { font-size: 18px; font-weight: 700; color: var(--olive); margin-bottom: 20px; }
.stock-display { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.stock-num { font-size: 64px; font-weight: 700; color: var(--olive); line-height: 1; min-width: 90px; }
.stock-num.low { color: var(--danger); }
.stock-right { display: flex; flex-direction: column; gap: 10px; }
.stock-adj-row { display: flex; gap: 10px; }
.btn-adj {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s;
  font-family: var(--font);
}
.btn-adj-minus { background: var(--bg); color: var(--olive); border: 1.5px solid var(--border); }
.btn-adj-minus:hover { background: var(--danger-bg); border-color: #fca5a5; color: var(--danger); }
.btn-adj-plus { background: var(--yellow); color: var(--olive-dark); }
.btn-adj-plus:hover { background: var(--yellow-deep); }
.stock-label { font-size: 14px; color: var(--hint); }
.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.set-row label { font-size: 14px; font-weight: 600; color: var(--olive); white-space: nowrap; margin-bottom: 0; }
.set-row input {
  width: 140px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--olive);
  background: var(--bg);
  outline: none;
  text-align: center;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.set-row input:focus { border-color: var(--yellow); background: #fff; box-shadow: 0 0 0 3px rgba(255,210,104,0.22); }
.save-hint { font-size: 13px; color: var(--hint); margin-left: auto; }
.save-hint.saved { color: var(--success); }

/* ── 工作人員帳號 ── */
.role-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.role-admin { background: var(--yellow-bg); color: var(--olive); border: 1px solid var(--yellow); }
.role-staff { background: var(--bg); color: var(--hint); border: 1px solid var(--border); }

/* ── 兌換確認 ── */
.redeem-main { max-width: 500px; margin: 0 auto; }
.mode-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}
.mode-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--hint);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s;
}
.mode-tab.active { background: var(--yellow); color: var(--olive-dark); font-weight: 700; }
.mode-tab .material-symbols-outlined { font-size: 20px; vertical-align: -3px; }
.qr-display-area {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.qr-canvas-wrap {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 2px solid var(--yellow);
  margin-bottom: 16px;
}
#qrCanvas { display: block; width: 220px; height: 220px; }
.qr-display-label { font-size: 15px; font-weight: 600; color: var(--olive); margin-bottom: 6px; }
.qr-display-hint  { font-size: 13px; color: var(--hint); line-height: 1.6; }
.qr-refresh-btn   { margin-top: 16px; }
.scan-area {
  background: #111;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.scan-frame {
  position: absolute;
  width: 65%;
  height: 65%;
  border: 3px solid var(--yellow);
  border-radius: 10px;
}
.scan-corner { position: absolute; width: 24px; height: 24px; border-color: var(--yellow); border-style: solid; }
.scan-corner.tl { top: 17.5%; left: 17.5%; border-width: 4px 0 0 4px; border-radius: 4px 0 0 0; }
.scan-corner.tr { top: 17.5%; right: 17.5%; border-width: 4px 4px 0 0; border-radius: 0 4px 0 0; }
.scan-corner.bl { bottom: 17.5%; left: 17.5%; border-width: 0 0 4px 4px; border-radius: 0 0 0 4px; }
.scan-corner.br { bottom: 17.5%; right: 17.5%; border-width: 0 4px 4px 0; border-radius: 0 0 4px 0; }
@keyframes scanbeam {
  0%, 100% { top: 20%; }
  50% { top: 72%; }
}
.scan-beam {
  position: absolute;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  animation: scanbeam 2s ease-in-out infinite;
}
.scan-placeholder-text { position: absolute; color: rgba(255,255,255,0.35); font-size: 13px; bottom: 12px; }
.scan-hint { text-align: center; font-size: 14px; color: var(--hint); margin-bottom: 16px; }
.result-card { border-radius: 14px; padding: 24px; text-align: center; margin-top: 16px; }
.result-card.success { background: var(--success-bg); border: 2px solid #6ee7b7; }
.result-card.error   { background: var(--danger-bg);  border: 2px solid #fca5a5; }
.result-card.already { background: var(--yellow-bg);  border: 2px solid var(--yellow); }
.result-icon { margin-bottom: 10px; }
.result-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.result-id   { font-size: 14px; color: var(--hint); margin-bottom: 14px; }
.result-msg  { font-size: 15px; font-weight: 600; }

/* ── 數據報表 ── */
.item-stat { background: var(--bg); border-radius: 10px; padding: 16px; text-align: center; border: 1px solid var(--border); }
.is-icon  { font-size: 28px; margin-bottom: 6px; line-height: 1; }
.is-icon .material-symbols-outlined { font-size: 28px; vertical-align: 0; }
.is-label { font-size: 13px; font-weight: 600; color: var(--olive); margin-bottom: 4px; }
.is-val   { font-size: 24px; font-weight: 700; color: var(--olive); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .topbar-menu-btn { display: flex; }

  .admin-content { padding: 16px; }

  .page-head {
    flex-direction: column;
    gap: 12px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
