/* 排班系統專屬樣式
   品牌色 / 字型 / .btn 基底沿用 css/style.css，本檔只放排班頁需要的元件 */

:root {
  --line: #ece6dc;
  --muted: #8c8276;
  --green: #6f9468;
  --radius: 16px;
}

/* 與主站一致：扣掉固定頁首高度後的內容區 */
.schedule-main { max-width: 880px; margin: 0 auto; padding: 28px 20px 90px; }

.page-head { text-align: center; margin-bottom: 8px; }
.page-head h2 { font-size: 1.7rem; color: var(--dark-purple); }
.page-head p { color: var(--muted); font-size: 0.95rem; margin-top: 6px; }
.eyebrow {
  display: inline-block; margin-bottom: 10px; padding: 5px 16px;
  border-radius: 999px; background: rgba(197, 160, 101, 0.12);
  color: var(--accent-gold); font-size: 0.75rem; letter-spacing: 2px;
}

/* 額外按鈕（.btn / .btn-gold / .btn-outline 來自 style.css） */
.btn-line { background: #06c755; color: #fff; border-color: #06c755; }
.btn-line:hover { filter: brightness(0.95); transform: translateY(-2px); }
.btn-ghost {
  background: transparent; border: 1px solid var(--line);
  padding: 7px 16px; border-radius: 999px; color: var(--muted);
  font-size: 0.82rem; cursor: pointer; transition: 0.25s; font-family: inherit;
  white-space: nowrap;   /* 中文按鈕文字不要逐字換行變直書 */
}
.btn-ghost:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

/* 頁首右側 */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-email { color: var(--muted); font-size: 0.8rem; }

/* 登入 / 提示卡 */
.center-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 24px; padding: 42px 32px; text-align: center;
  margin: 48px auto 0; max-width: 460px;
  box-shadow: 0 14px 40px rgba(106, 90, 138, 0.08);
}
.center-card h2 { color: var(--dark-purple); margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.error { color: #b5524a; font-size: 0.9rem; }

/* 登入畫面 */
.login-card { padding-top: 36px; }
.login-card .eyebrow { margin-top: 4px; }
.login-icon {
  width: 64px; height: 64px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 1.6rem; color: var(--accent-gold);
  background: rgba(197, 160, 101, 0.12);
}
.login-icon.denied { color: #b5847b; background: rgba(181, 132, 123, 0.12); }

/* 官方樣式 Google 登入按鈕 */
.btn-google {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 22px; padding: 12px 22px;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 999px;
  font-size: 0.95rem; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: 0.2s;
}
.btn-google:hover { background: #f8f9fa; border-color: #d2d5da; box-shadow: 0 1px 6px rgba(60, 64, 67, 0.15); }
.btn-google:active { background: #f1f3f4; }
.btn-google:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* LINE 版登入按鈕（沿用 .btn-google 版型、換 LINE 綠；與 admin.css .btn-line-login 同款） */
.btn-google.btn-line-login { margin-top: 10px; background: #06c755; border-color: #06c755; color: #fff; }
.btn-google.btn-line-login:hover { background: #05b34c; border-color: #05b34c; box-shadow: 0 1px 6px rgba(6, 199, 85, .3); }
.btn-google.btn-line-login i { font-size: 20px; line-height: 1; }

.login-foot { margin-top: 24px; font-size: 0.78rem; color: var(--muted); }
.login-foot a { color: var(--accent-gold); }
.login-foot a:hover { text-decoration: underline; }

/* 月份切換 */
.month-nav {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 26px 0 22px;
}
.month-label { font-size: 1.15rem; font-weight: 600; color: var(--dark-purple); min-width: 140px; text-align: center; }

/* 日期分組 */
.day { margin-bottom: 26px; }
.day-title {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 1rem; color: var(--dark-purple); font-weight: 600;
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px;
}
.day-title .weekday { font-size: 0.82rem; color: var(--accent-gold); }

/* 客人端時段卡 */
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.slot {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 6px 18px rgba(106, 90, 138, 0.05);
}
.slot-time { font-size: 1.1rem; font-weight: 600; color: var(--text-charcoal); }
.slot-note { font-size: 0.8rem; color: var(--muted); }
.badge {
  align-self: flex-start; font-size: 0.78rem; padding: 3px 12px;
  border-radius: 999px; font-weight: 500;
}
.badge-open { background: rgba(111, 148, 104, 0.14); color: var(--green); }
.badge-booked { background: rgba(140, 130, 118, 0.14); color: var(--muted); }
.slot.booked { opacity: 0.72; }

/* ── 月曆檢視（客人端） ───────────────── */
.calendar { max-width: 440px; margin: 0 auto; }
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.cal-title { font-size: 1.35rem; font-weight: 700; color: var(--text-charcoal); }
.cal-nav {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary-purple); color: #fff; border: none;
  font-size: 1.1rem; cursor: pointer; transition: 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.cal-nav:hover { background: var(--dark-purple); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 2px; }
.cal-weekday {
  text-align: center; font-weight: 700; color: var(--text-charcoal);
  padding: 6px 0 10px; font-size: 1rem;
}
.cal-day {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; border-radius: 12px; user-select: none;
}
.cal-day.muted { color: #cfcacf; }                 /* 非本月 / 無時段，灰色不可點 */
.cal-day.available {
  color: var(--dark-purple); font-weight: 700; cursor: pointer;
  border: 1px solid transparent; transition: 0.15s;
}
.cal-day.available:hover { background: rgba(150, 134, 184, 0.12); }
.cal-day.selected { background: var(--primary-purple); color: #fff; font-weight: 700; }

/* ── 當天時段格子 ───────────────────── */
.day-panel { max-width: 440px; margin: 28px auto 0; }
.day-panel-title { font-size: 1.05rem; font-weight: 700; color: var(--dark-purple); margin-bottom: 14px; }
.day-panel-empty { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 16px 0; }
.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.time-pill {
  padding: 12px 0; text-align: center; border-radius: 12px;
  border: 1px solid var(--primary-purple); color: var(--dark-purple);
  font-size: 1rem; cursor: pointer; transition: 0.15s; background: #fff;
}
.time-pill:hover { background: rgba(150, 134, 184, 0.1); }
.time-pill.disabled {
  border-color: #e6e3e6; color: #c9c4c9; cursor: not-allowed; background: #fff;
}
.time-pill.selected { background: var(--primary-purple); color: #fff; border-color: var(--primary-purple); }

@media (max-width: 360px) {
  .time-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── 管理端：固定時段格子（可編輯狀態） ── */
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 440px; margin: 0 auto; }
.admin-cell {
  padding: 9px 4px; text-align: center; border-radius: 12px;
  border: 1px solid var(--primary-purple); color: var(--dark-purple);
  background: #fff; cursor: pointer; font-size: 0.95rem; transition: 0.15s; line-height: 1.3;
}
.admin-cell:hover { background: rgba(150, 134, 184, 0.1); }
.admin-cell .who-tag { display: block; font-size: 0.7rem; margin-top: 2px; opacity: 0.95; }
.admin-cell.booked { background: var(--accent-gold); border-color: var(--accent-gold); color: #fff; }
.admin-cell.booked:hover { filter: brightness(0.97); background: var(--accent-gold); }
.admin-cell.closed { background: #f1eef1; border-color: #e6e3e6; color: #c4bfc4; }
.admin-legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 16px; font-size: 0.8rem; color: var(--muted); }
.admin-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.lg-open { border: 1px solid var(--primary-purple); background: #fff; }
.lg-booked { background: var(--accent-gold); }
.lg-closed { background: #f1eef1; border: 1px solid #e6e3e6; }

/* ── 營業時間設定面板 ───────────────── */
.settings-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.settings-form > label { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; color: var(--muted); }
.settings-form input, .settings-form select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.92rem; font-family: inherit; background: var(--bg-cream);
}
.settings-form input:focus, .settings-form select:focus { outline: none; border-color: var(--accent-gold); }
.settings-weekdays { display: flex; flex-direction: column; gap: 6px; }
.settings-weekdays-label { font-size: 0.78rem; color: var(--muted); }
.weekday-chips { display: flex; gap: 6px; }
.weekday-chip {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 0.9rem; cursor: pointer; transition: 0.15s; font-family: inherit;
}
.weekday-chip:hover { border-color: var(--primary-purple); }
.weekday-chip.on { background: var(--primary-purple); border-color: var(--primary-purple); color: #fff; font-weight: 700; }

/* ── 點格子的動作選單 ───────────────── */
.action-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(60, 50, 70, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
/* hidden 屬性必須蓋過上面的 display:flex，否則選單關不掉 */
.action-overlay[hidden] { display: none; }
.action-card {
  background: #fff; width: 100%; max-width: 420px;
  border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
  animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(20px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.action-title { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }
.action-btn {
  display: block; width: 100%; text-align: center;
  padding: 13px; margin-top: 8px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--text-charcoal);
  font-size: 1rem; font-family: inherit; cursor: pointer; transition: 0.15s;
}
.action-btn:hover { background: var(--bg-cream); }
.action-btn i { margin-right: 6px; }
.action-btn.act-open { border-color: var(--primary-purple); color: var(--dark-purple); }
.action-btn.act-booked { border-color: var(--accent-gold); color: #a7813f; }
.action-btn.act-closed { color: var(--muted); }
.action-btn.cancel { margin-top: 12px; background: var(--bg-cream); color: var(--muted); border: none; }

@media (min-width: 520px) {
  .action-overlay { align-items: center; }
  .action-card { border-radius: 20px; }
}

/* 客人端 LINE 預約區 */
.book-cta {
  margin-top: 34px; text-align: center; padding: 30px;
  background: rgba(197, 160, 101, 0.08); border-radius: 20px;
}
.book-cta p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }

/* 管理端：排班表單 */
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(106, 90, 138, 0.06);
}
.panel h3 { font-size: 1.05rem; color: var(--dark-purple); margin-bottom: 14px; }
.slot-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.slot-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; color: var(--muted); }
.slot-form .grow { flex: 1; min-width: 160px; }
.slot-form input {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.92rem; font-family: inherit; background: var(--bg-cream);
}
.slot-form input:focus { outline: none; border-color: var(--accent-gold); }
.slot-form .btn { cursor: pointer; }

/* 管理端：時段列 */
.admin-slot {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.admin-slot.booked { border-color: rgba(197, 160, 101, 0.4); background: #fdf9f2; }
.admin-slot .slot-time { min-width: 120px; }
.admin-slot .who {
  flex: 1; min-width: 140px;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.88rem; font-family: inherit; background: var(--bg-cream);
}
.admin-slot .who::placeholder { color: #c2b8a8; }
.admin-actions { display: flex; gap: 8px; margin-left: auto; }
.btn-mini {
  background: #fff; border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; color: var(--muted);
  cursor: pointer; transition: 0.25s; font-family: inherit;
}
.btn-mini:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.btn-mini.is-booked { background: var(--accent-gold); color: #fff; border-color: var(--accent-gold); }
.btn-mini.danger:hover { border-color: #c98; color: #b5524a; }

@media (max-width: 520px) {
  .admin-slot .admin-actions { margin-left: 0; width: 100%; }
  .slot-form label { flex: 1; min-width: 120px; }
}
