/* 後台介面（淺色，與前台區隔） */
.adm { --a-bg: #f4f3f1; --a-card: #fff; --a-line: #e2dfda; --a-ink: #22201d; --a-sub: #6f6a63; --a-pri: #2f5d8a; --a-red: #c0392b; --a-green: #2e7d32;
  position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--a-bg); color: var(--a-ink); font: 14px/1.5 "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif; }
.adm * { box-sizing: border-box; }
.adm a { color: var(--a-pri); }
.adm-top { display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 50px; background: #22201d; color: #fff; flex: none; overflow-x: auto; }
.adm-top .tag { font-size: 12px; color: #f1d9a8; border: 1px dashed #d9a441; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.adm-tabs { display: flex; gap: 2px; }
.adm-tabs a { color: #ddd; text-decoration: none; padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.adm-tabs a.on, .adm-tabs a:hover { background: #3a3733; color: #fff; }
.adm-top .sp, .ed-bar .sp { flex: 1; }
.adm-top .clock { font-size: 12px; color: #bbb; white-space: nowrap; } .adm-top .clock.fixed { color: #ffcf70; font-weight: 700; }
.adm-top .a-btn { background: #3a3733; color: #fff; border-color: #55504a; }
.adm-body { flex: 1; min-height: 0; overflow: auto; } .adm-body.pad { padding: 16px; }
.a-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--a-line); border-radius: 6px; background: #fff; color: var(--a-ink); cursor: pointer; text-decoration: none; font-size: 13px; white-space: nowrap; }
.a-btn:hover { border-color: #b9b4ac; }
.a-btn.primary { background: var(--a-pri); border-color: var(--a-pri); color: #fff; }
.a-btn.danger { color: var(--a-red); border-color: #e7b7b1; }
.a-btn.small { padding: 3px 8px; font-size: 12px; } .a-btn.full { width: 100%; justify-content: center; }
.a-btn:disabled { opacity: .45; cursor: default; }
.card { background: var(--a-card); border: 1px solid var(--a-line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 10px; flex-wrap: wrap; }
.sub-h { font-weight: 700; margin: 14px 0 6px; font-size: 13px; color: #3c3a36; }
.hint { color: var(--a-sub); font-size: 12px; } .none { color: var(--a-sub); }
.warn { color: #8a5a00; background: #fff5dd; border: 1px solid #f1d9a0; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.a-msg { padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; } .a-msg.ok { background: #e8f5e9; color: #1b5e20; } .a-msg.err { background: #fdecea; color: #8e2a1f; }
.err { color: var(--a-red); font-size: 13px; }
.adm input, .adm select, .adm textarea { font: inherit; padding: 5px 8px; border: 1px solid #cfcac2; border-radius: 5px; background: #fff; color: var(--a-ink); min-width: 0; }
.adm label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #4a4640; }
.adm label.chk { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.fgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.fgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.fgrid { display: grid; gap: 10px; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.row-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inl { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.two-col.wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.two-col.even { grid-template-columns: 1fr 1fr; }
.pill { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 9px; background: #ecebe8; color: #555; margin: 1px 2px 1px 0; white-space: nowrap; }
.pill.green { background: #e3f3e4; color: #1b5e20; } .pill.gray { background: #eee; color: #888; } .pill.red { background: #fdecea; color: #b3261e; }
.tbl-wrap { overflow: auto; max-height: calc(100vh - 190px); padding: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #efece8; white-space: nowrap; }
.tbl th { position: sticky; top: 0; background: #faf9f7; font-size: 12px; color: #555; }
.tbl tr[data-id] { cursor: pointer; } .tbl tr[data-id]:hover { background: #f7f5f1; } .tbl tr.cur { background: #e9f0f7; } .tbl tr.cancelled td { color: #999; }
.tbl.small td { white-space: normal; font-size: 12px; vertical-align: top; }
.tbl tr.audit-bad td { background: #fdecec; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .filters input[name=q] { width: 240px; }
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 4px; } .tlist li.cur { background: #e9f0f7; }
.tlist a { flex: 1; display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.tlist img { width: 40px; height: 56px; object-fit: cover; border-radius: 3px; } .tlist small { display: block; color: var(--a-sub); } .tlist em { color: var(--a-red); font-style: normal; }
.ord button { border: 1px solid var(--a-line); background: #fff; border-radius: 4px; cursor: pointer; }
.poster-pick { display: flex; gap: 12px; align-items: flex-start; } .poster-pick img { width: 80px; aspect-ratio: 252/380; object-fit: cover; border-radius: 4px; background: #ddd; }
.poster-pick > div { display: flex; flex-direction: column; gap: 8px; }
.exc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.chips li { background: #f4f2ee; border-radius: 6px; padding: 3px 8px; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.chips button { border: 0; background: none; color: var(--a-red); cursor: pointer; }
.slot-prev { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-prev span { padding: 4px 10px; border-radius: 6px; font-size: 12px; display: flex; flex-direction: column; min-width: 92px; }
.sp-available { background: #e3f3e4; color: #1b5e20; } .sp-booked { background: #dfe8f3; color: #1f4e79; } .sp-calendar { background: #efe3f6; color: #5b2a86; }
.sp-pending { background: #fff0cc; color: #7a5600; } .sp-blocked { background: #eceae6; color: #555; } .sp-cutoff, .sp-past, .sp-outside, .sp-inactive { background: #f3f3f3; color: #999; } .sp-paused { background: #fdecea; color: #b3261e; }
.mini { margin: 0; padding-left: 18px; font-size: 12px; }
/* 日曆模擬 */
.test-zone { border: 2px dashed #d9a441; border-radius: 12px; padding: 12px; background: #fffaf0; }
.tz-h { font-weight: 700; color: #7a5600; margin-bottom: 12px; }
.timeline { position: relative; padding-top: 20px; }
.hours { position: relative; height: 16px; margin-left: 70px; font-size: 11px; color: #777; } .hours span { position: absolute; transform: translateX(-50%); }
.lane { display: flex; align-items: center; height: 44px; border-top: 1px solid #eee; }
.lname { width: 70px; flex: none; font-weight: 700; font-size: 13px; } .lname em { color: var(--a-red); font-style: normal; font-size: 11px; }
.ltrack { position: relative; flex: 1; height: 100%; background: repeating-linear-gradient(90deg, #fafafa 0 calc(100% / 14 - 1px), #eee calc(100% / 14 - 1px) calc(100% / 14)); }
.tl-slot { position: absolute; top: 4px; height: 24px; border-radius: 4px; font-size: 11px; padding: 3px 4px; overflow: hidden; white-space: nowrap; border: 1px solid rgba(0, 0, 0, .06); }
.tl-ev { position: absolute; bottom: 3px; height: 8px; border-radius: 3px; background: #5b2a86; } .tl-ev.website { background: #1f4e79; } .tl-ev.pend { background: #d49a00; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 12px; } .legend span { padding: 2px 8px; border-radius: 5px; } .legend .ev-key { color: #5b2a86; }
.evlist { list-style: none; margin: 0; padding: 0; } .evlist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0ede8; }
.evlist li > div { flex: 1; min-width: 0; } .evlist small { display: block; color: var(--a-sub); } .evlist em { color: #b36b00; font-style: normal; }
.evact { display: flex; gap: 4px; flex-wrap: wrap; }
.src { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #efe3f6; color: #5b2a86; } .src.website { background: #dfe8f3; color: #1f4e79; }
.health { display: flex; flex-wrap: wrap; gap: 16px; }
/* 寄信模擬 */
.mlist2 { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 220px); overflow: auto; }
.mlist2 li a { display: block; padding: 8px; border-bottom: 1px solid #f0ede8; color: inherit; text-decoration: none; } .mlist2 li.cur a { background: #e9f0f7; } .mlist2 small { display: block; color: var(--a-sub); }
.mmeta { font-size: 12px; color: var(--a-sub); margin-bottom: 10px; }
.mail { max-width: 560px; border: 1px solid #ddd; border-radius: 8px; padding: 20px; background: #fff; }
.mail .mhead { font-weight: 800; font-size: 18px; border-bottom: 2px solid #22201d; padding-bottom: 8px; margin-bottom: 12px; }
.mail table { border-collapse: collapse; margin: 10px 0; } .mail td { padding: 4px 12px 4px 0; } .mail td:first-child { color: #777; }
.mail .mbtn { display: inline-block; background: #22201d; color: #fff; padding: 10px 18px; border-radius: 6px; text-decoration: none; margin: 8px 0; } .mail .small { font-size: 12px; color: #777; }


/* 每日場次與時段預覽的操作按鈕 */
.daily { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border: 1px solid var(--a-line); border-radius: 16px; background: #faf9f7; font-weight: 700; font-size: 13px; }
.tchip button, .chips button, .slot-prev button { border: 1px solid #e7b7b1; background: #fff; color: var(--a-red); border-radius: 12px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.tchip button:hover, .chips button:hover, .slot-prev button:hover { background: var(--a-red); color: #fff; }
.slot-prev button { margin-top: 4px; align-self: flex-start; }
.sp-closed button { border-color: #9cc59e; color: var(--a-green); } .sp-closed button:hover { background: var(--a-green); }
.slot-prev em { font-style: normal; font-size: 11px; opacity: .8; margin-top: 3px; }
.sp-closed { background: #f3e9e8; color: #8e2a1f; }
.row-btns .sp { flex: 1; }

/* 1.5A 特殊日期 */
.dgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dgrid .wd { text-align: center; font-size: 12px; color: #888; }
.dcell { border: 1px solid #e3e1dd; background: #fff; border-radius: 6px; padding: 4px 2px; min-height: 56px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; }
.dcell b { font-size: 14px; } .dcell small { font-size: 11px; } .dcell em { font-style: normal; font-size: 10px; color: #b3261e; line-height: 1.1; text-align: center; }
.dcell.today { outline: 2px solid #22201d; }
.dcell.ovr { border: 2px solid #d9a441; }
.dc-WEEKDAY { color: #333; } .dcell.dc-HOLIDAY { background: #fdecea; color: #b3261e; } .dcell.dc-LONG_HOLIDAY { background: #f8d4cf; color: #8c1d18; } .dcell.dc-PENDING { background: #fff4d6; color: #6b4e00; }
.dc { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 12px; }
span.dc-WEEKDAY { background: #ecebe8; } span.dc-HOLIDAY { background: #fdecea; color: #b3261e; } span.dc-LONG_HOLIDAY { background: #f8d4cf; color: #8c1d18; } span.dc-PENDING { background: #fff4d6; color: #6b4e00; }
.dlegend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12px; color: #777; align-items: center; }
tr.ovl td { background: #fff7e0; }
.ok-t { color: #1b5e20; } .warn-t { color: #b3261e; }
.rule-prev { font-size: 13px; }
.dprev { max-height: 360px; overflow: auto; }
.dprev thead th { position: sticky; top: 0; background: #faf9f7; }

/* Google 日曆連線卡片 */
.gcal .gcal-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0 12px; font-size: 14px; }
.gcal .gcal-kv dt { color: #6b6257; }
.gcal .gcal-kv dd { margin: 0; }
.gcal.warn { border-color: #d98b41; }
/* 已連接真實日曆：隱藏模擬工具（改到 Google 日曆操作）；待處理與異常訂單的處理仍保留 */
.gcal-live { border-style: solid; border-color: #c9d6c3; background: #f7fbf5; }
.gcal-live .tz-h { color: #2f5a2a; }
.gcal-live .card:has(#evform), .gcal-live .sim-only, .gcal-live .card:has(.health) { display: none; }

/* 搜尋與分享：圖片預覽 */
.seo-img { display: flex; align-items: center; gap: 8px; margin-top: 4px; } .seo-img img { width: 64px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid #444; } .seo-img i { color: #888; font-size: 12px; }

/* 網站編輯：預約頁面預覽（點一下選取、雙擊直接改字） */
.ge-bookprev .ge-bk { cursor: text; outline: 1px dashed transparent; outline-offset: 3px; border-radius: 3px; transition: outline-color .15s; }
.ge-bookprev .ge-bk:hover { outline-color: rgba(232, 199, 122, .7); }
.ge-bookprev .ge-bk-sel { outline: 2px solid #e8c77a; }
.ge-bookprev .ge-bk-editing { outline: 2px solid #4da3ff; background: rgba(77, 163, 255, .12); }
.ge-bookprev button, .ge-bookprev a, .ge-bookprev input, .ge-bookprev select { pointer-events: auto; }
.gp .bk-on { background: rgba(232, 199, 122, .15); border-radius: 6px; padding: 4px; }

/* 流量統計 */
.stat-kpi { display: flex; gap: 28px; margin: 6px 0 14px; } .stat-kpi b { display: block; font-size: 28px; } .stat-kpi small { color: #888; }
.stat-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 6px 0 18px; border-bottom: 1px solid #333; }
.stat-chart .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.stat-chart .bar i { width: 100%; background: #e8c77a; border-radius: 3px 3px 0 0; min-height: 1px; }
.stat-chart .bar span { position: absolute; bottom: -16px; font-size: 10px; color: #888; }
.stable { width: 100%; border-collapse: collapse; } .stable td { padding: 5px 4px; border-bottom: 1px solid #2a2a2a; } .stable td.n { text-align: right; font-variant-numeric: tabular-nums; }
.dev { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .dev span { width: 70px; } .dev i { flex: 1; height: 10px; background: #2a2a2a; border-radius: 5px; overflow: hidden; } .dev i b { display: block; height: 100%; background: #e8c77a; } .dev em { width: 40px; text-align: right; font-style: normal; }
.seg-inline { float: right; display: inline-flex; gap: 4px; }

.gp .bk-fail { display: block; color: #ff9b8a; font-size: 12px; margin-top: 4px; }
.gp .bk-fail.wait { color: #aaa; }
.adm-top .tag.prod { background: #2e7d32; color: #fff; }
