/* 游泳課程管理系統 - 專業海洋色主題（base / reset / layout） */
/* 設計 Token 已抽出至 css/tokens.css，請優先以 var(--sw-*) 引用，避免在此重複定義。 */
* {margin:0;padding:0;box-sizing:border-box}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--sw-font-family);
  background: var(--sw-bg-app);
  min-height: 100vh;
  padding: var(--sw-body-pad);
  color: var(--sw-text);
  font-size: var(--sw-font-md);
  line-height: 1.45;
}

button,
input,
select,
textarea,
option {
  font-family: var(--sw-font-family);
}

body.modal-open {
  overflow: hidden;
}

/* 主容器（不可 overflow:hidden，否則內層 position:sticky 無法貼齊視窗頂） */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--sw-surface);
  border-radius: var(--sw-radius-xl);
  overflow: visible;
  box-shadow: var(--sw-shadow-wrap);
  min-height: calc(100vh - 2 * var(--sw-body-pad));
}

.hdr-brand {
  display: flex;
  align-items: center;
  gap: var(--sw-space-3);
  position: relative;
  z-index: 1;
}

/* 頂部標題區（淺色，對齊預約頁） */
.hdr {
  background: var(--sw-gradient-hdr);
  color: var(--sw-text-on-hdr);
  padding: var(--sw-space-6) 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  border-bottom: 1px solid var(--sw-border);
}

.hdr::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hdr h1 {
  font-size: var(--sw-font-hdr);
  font-weight: 600;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
  color: var(--sw-text-on-hdr);
}

.hdr small,
.hdr-tagline {
  color: var(--sw-text-muted);
  font-size: 13px;
  display: block;
  margin-top: 4px;
  opacity: 1;
}

.hdr-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hdr-btn {
  padding: 8px 16px;
  background: var(--sw-hdr-btn-bg);
  border: 1px solid var(--sw-hdr-btn-border);
  color: var(--sw-hdr-btn-text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: var(--sw-shadow-sm);
}

.hdr-btn:hover {
  background: var(--sw-surface-muted);
  color: var(--sw-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--sw-shadow-md);
}

/* Header 快速指令 */
.hdr-btn--quick-cmd {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: var(--sw-primary-deep);
  font-weight: 600;
}

.sw-quick-cmd-modal .sw-quick-cmd-lead {
  font-size: 14px;
  color: #475569;
  margin: 0 0 8px;
  line-height: 1.5;
}

.sw-quick-cmd-hints {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 12px 1.1em;
  line-height: 1.6;
}

.sw-quick-cmd-hints code {
  font-size: 12px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0f172a;
}

.sw-quick-cmd-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.sw-quick-cmd-chip {
  font-size: 12px;
}

.sw-quick-cmd-input {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.sw-quick-cmd-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sw-quick-cmd-result {
  margin-top: 14px;
  padding: 12px;
  min-height: 2.5em;
  max-height: 200px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.sw-quick-cmd-result__p {
  margin: 0;
}

.sw-quick-cmd-result__p + .sw-quick-cmd-result__p {
  margin-top: 8px;
}

.sw-quick-cmd-result__ok {
  color: #0d9488;
}

.sw-quick-cmd-result__ul {
  margin: 8px 0 0 1.1em;
  padding: 0;
}

.sw-quick-cmd-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sw-quick-cmd-tab {
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sw-quick-cmd-tab--active {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

.sw-quick-cmd-voice-panel {
  margin-top: 4px;
}

.sw-voice-rec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sw-voice-status {
  font-size: 13px;
  color: #64748b;
  flex: 1;
  min-width: 120px;
}

.sw-voice-preview {
  margin-top: 14px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: #14532d;
  max-height: 280px;
  overflow: auto;
}

.sw-voice-preview__card p {
  margin: 0 0 8px;
}

.sw-voice-preview__ul {
  margin: 4px 0 8px 1.2em;
  padding: 0;
}

.sw-voice-preview__transcript {
  margin: 0 0 10px;
  color: #334155;
}

/* 標籤導航：向下滑時貼齊視窗頂，banner 可捲出畫面 */
.tabs {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  background: var(--sw-gradient-tabs);
  overflow-x: auto;
  border-bottom: 3px solid var(--sw-primary);
  padding: 0 10px;
  gap: 2px;
  scrollbar-width: thin;
  box-shadow: var(--sw-shadow-sm);
}

.tab {
  padding: 16px 20px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s ease;
  color: var(--sw-text-muted);
  position: relative;
  border-radius: var(--sw-radius-md) var(--sw-radius-md) 0 0;
  min-height: 56px;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--sw-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab:hover {
  background: rgba(2, 132, 199, 0.1);
  color: var(--sw-primary);
}

.tab.active {
  color: var(--sw-primary);
  background: var(--sw-surface);
}

.tab.active::after {
  transform: scaleX(1);
}

.tab:focus-visible,
.hdr-btn:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(2, 132, 199, 0.25);
  outline-offset: 2px;
}

/* 內容區域：改由整頁（html/body）捲動，主選單列才可用 sticky 固定 */
.body {
  padding: var(--sw-pane-pad);
  overflow: visible;
  min-height: 0;
  background: var(--sw-bg-body);
  border-radius: 0 0 var(--sw-radius-xl) var(--sw-radius-xl);
}

.pane {
  display: none;
}

.pane.active {
  display: block;
  animation: fi 0.4s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  .pane.active {
    animation: none;
  }
}

/* 表單樣式 */
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.fg {
  margin-bottom: 16px;
}

.fg label,
.fg .fg-field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--sw-text);
  font-size: var(--sw-font-base);
}

.fg input,
.fg select,
.fg textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--sw-border);
  border-radius: var(--sw-btn-radius);
  font-size: var(--sw-font-md);
  transition: all 0.3s ease;
  font-family: inherit;
  background: var(--sw-surface-muted);
}

.fg textarea {
  resize: vertical;
  min-height: 80px;
}

.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  outline: none;
  border-color: var(--sw-primary);
  background: var(--sw-surface);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
}

.fg input[readonly] {
  background: #f1f5f9;
  color: var(--sw-text-muted);
}

.fg input::placeholder,
.fg textarea::placeholder {
  color: var(--sw-text-muted);
  opacity: 1;
}

/* 表單內 checkbox / radio 勿套用 width:100%，避免與文字同一列時被拉開 */
.fg input[type="checkbox"],
.fg input[type="radio"] {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
}

/* 登入「記住我」：勾選靠左、文字緊貼 */
.login-remember-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 16px;
  margin-top: -4px;
  width: 100%;
}

.login-remember-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.login-remember-row label {
  display: inline;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
  color: #334155;
  font-size: 14px;
  line-height: 1.35;
  flex: 0 1 auto;
}

/* 密碼欄 + 顯示／隱藏（.m-pw-toggle，邏輯在 membership.js initPasswordFieldToggles） */
.m-password-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.fg .m-password-wrap > input,
.modal .m-password-wrap > input {
  flex: 1;
  min-width: 0;
  border-radius: 6px 0 0 6px;
}
.m-pw-toggle {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-left: none;
  border-radius: 0 6px 6px 0;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  font-family: inherit;
  color: #475569;
}
.m-pw-toggle:hover {
  background: #e2e8f0;
}

/* 登入 Modal：分頁按鈕（與 switchLoginTab 的 .active 同步，避免 inline 樣式導致分頁外觀錯亂） */
#loginModal .login-modal-tabs {
  display: flex;
  border-bottom: 2px solid #eee;
  margin-bottom: 20px;
}

#loginModal .login-modal-tab {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: #f8f9fa;
  color: #666;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.22s ease, color 0.22s ease, transform 0.18s ease;
}

#loginModal .login-modal-tab:hover {
  background: #e2e8f0;
  color: #334155;
}

#loginModal .login-modal-tab.active {
  background: var(--sw-primary);
  color: #fff;
}

#loginModal .login-modal-tab.active:hover {
  color: #fff;
  filter: brightness(1.05);
}

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

#loginModal .login-modal-panel--flash {
  animation: loginModalPanelIn 0.28s ease-out;
}

/* 按鈕樣式 */
.btn {
  background: var(--sw-gradient-btn);
  color: #fff;
  padding: var(--sw-btn-pad-y) var(--sw-btn-pad-x);
  border: none;
  border-radius: var(--sw-btn-radius);
  font-size: var(--sw-btn-font);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: var(--sw-space-2);
  transition: all 0.3s ease;
  box-shadow: var(--sw-shadow-btn);
  min-height: var(--sw-btn-min-h);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.4);
}

/* 卡片統計 */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  padding: 20px;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 8px;
  font-weight: 500;
}

.card .val {
  font-size: 28px;
  font-weight: 700;
}

/* 統計卡片色調（淺底 + 左色條） */
.cards .card.sw-tone-1,
.cards .card.sw-tone-2,
.cards .card.sw-tone-3,
.cards .card.sw-tone-4,
.cards .card.sw-tone-neutral,
.cards .card.sw-tone-warm,
.cards .card.sw-tone-success,
.cards .card.sw-tone-danger,
.cards .card.sw-tone-sen {
  color: var(--sw-text);
  box-shadow: var(--sw-shadow-card);
  border: 1px solid var(--sw-border);
}

.cards .card.sw-tone-1 { background: #f0f9ff; border-left: 4px solid #0284c7; }
.cards .card.sw-tone-2 { background: #ecfeff; border-left: 4px solid #06b6d4; }
.cards .card.sw-tone-3 { background: #f0f9ff; border-left: 4px solid #0891b2; }
.cards .card.sw-tone-4 { background: #e0f2fe; border-left: 4px solid #0ea5e9; }
.cards .card.sw-tone-neutral { background: #f8fafc; border-left: 4px solid #64748b; }
.cards .card.sw-tone-warm { background: #fff7ed; border-left: 4px solid #ea580c; }
.cards .card.sw-tone-success { background: #ecfdf5; border-left: 4px solid #10b981; }
.cards .card.sw-tone-danger { background: #fef2f2; border-left: 4px solid #ef4444; }
.cards .card.sw-tone-sen { background: #f0fdfa; border-left: 4px solid #0d9488; }

.cards .card h3 {
  color: var(--sw-text-muted);
  opacity: 1;
}

.cards .card .val {
  color: var(--sw-primary-deep);
}

/* 表格樣式 */
.tbl-wrap {
  overflow-x: auto;
  margin-top: var(--sw-space-4);
  border-radius: var(--sw-radius-md);
  box-shadow: var(--sw-shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sw-table-font);
  background: var(--sw-surface);
}

thead {
  background: var(--sw-gradient-thead);
  color: var(--sw-table-th-color);
}

th, td {
  padding: var(--sw-table-cell-pad-y) var(--sw-table-cell-pad-x);
  text-align: left;
  border-bottom: 1px solid var(--sw-border);
}

th {
  font-size: var(--sw-table-th-font);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: var(--sw-table-th-border);
}

tr:hover td {
  background: var(--sw-table-row-hover);
}

/* 動作按鈕 */
.abs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bs {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 600;
}

.bs:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.bv { background: #f59e0b; color: #fff; }
.bd { background: #ef4444; color: #fff; }
.bp { background: #3b82f6; color: #fff; }
.be { background: #10b981; color: #fff; }

/* 彈出視窗 */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  z-index: 999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal.on {
  display: flex;
}

.mc {
  background: var(--sw-surface);
  padding: var(--sw-space-5);
  border-radius: var(--sw-radius-lg);
  max-width: 680px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  animation: su 0.3s ease-out;
  box-shadow: var(--sw-shadow-lg);
}

.dynamic-modal__card {
  width: min(920px, 92vw);
}

.dynamic-modal__body {
  padding: 4px 0 0;
}

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

.mh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
}

.mh h3 {
  font-size: 18px;
  color: #0c4a6e;
}

.mx {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.mx:hover {
  background: #dc2626;
  transform: scale(1.05);
}

/* 通知提示 */
.notif {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 24px;
  color: #fff;
  border-radius: 10px;
  z-index: 9999;
  display: none;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  font-size: 14px;
}

.notif.on {
  display: block;
  animation: sr 0.4s ease-out;
}

@keyframes sr {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notif.ok { background: linear-gradient(135deg, #10b981, #059669); }
.notif.err { background: linear-gradient(135deg, #ef4444, #dc2626); }
.notif.warn { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* 日曆 */
.cal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cal-hdr button {
  padding: 8px 16px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cal-hdr button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cd {
  padding: 10px 4px;
  text-align: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  background: #fff;
}

.cd:hover:not(.dis):not(.ch) {
  background: #e0f2fe;
  border-color: #0284c7;
}

.cd.sel {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-weight: 600;
  border-color: #0284c7;
}

.cd.dis {
  background: #f1f5f9;
  color: #cbd5e1;
  cursor: not-allowed;
}

.cd.ch {
  background: #e2e8f0;
  font-weight: 600;
  cursor: default;
  font-size: 11px;
}

/* 預約月曆：香港公眾假期（一般假日） */
#calGrid .cd:not(.ch) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 3px;
}

#calGrid .cd.hk-holiday:not(.sel):not(.ch) {
  background: #fff7ed;
  border-color: #fdba74;
}

#calGrid .cd.hk-holiday.dis:not(.sel) {
  background: #ffedd5;
  color: #57534e;
}

#calGrid .cd.hk-holiday.dis:not(.sel) .cd-dayn {
  color: #78716c;
}

#calGrid .cd.hk-holiday.sel {
  border-color: #fb923c;
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.35);
}

#calGrid .cd .cd-hk-holiday-lbl {
  display: block;
  max-width: 100%;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 600;
  color: #9a3412;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#calGrid .cd.hk-holiday.sel .cd-hk-holiday-lbl {
  color: rgba(255, 255, 255, 0.95);
}

#calGrid .cd.hk-holiday.sel .cd-dayn {
  color: #fff;
}

/* 已選日期列表：公眾假期提示 */
.dt-hk-holiday {
  flex-basis: 100%;
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #7c2d12;
  background: #fff7ed;
  border-radius: 6px;
  border: 1px solid #fed7aa;
}

.dt-hk-holiday-badge {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #ea580c;
  border-radius: 4px;
  vertical-align: middle;
}

.dt-hk-holiday-hint {
  margin-left: 4px;
  font-size: 11px;
  color: #c2410c;
  text-decoration: underline;
  cursor: help;
}

/* 時段選擇 */
.ts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.ts {
  padding: 10px 6px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  transition: all 0.2s ease;
  background: #fff;
}

.ts:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.ts.sel {
  border-color: #0284c7;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  font-weight: 600;
  color: #0369a1;
}

/* 付款方式 */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.pm {
  padding: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  background: #fff;
  font-size: 13px;
}

.pm:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.pm.sel {
  border-color: #0284c7;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  font-weight: 600;
  color: #0369a1;
}

/* SEN 學生分類 */
.sen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.sn {
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  transition: all 0.2s ease;
  background: #fff;
}

.sn:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.sn.sel {
  border-color: #0284c7;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  font-weight: 600;
  color: #0369a1;
}

/* 預約嚮導：學生分類（.sen-option）選中狀態 */
#wizardContent .sen-option.sel {
  border-color: #0284c7;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  font-weight: 600;
  color: #0369a1;
}

#wizardContent .sen-option:focus {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

/* 預約嚮導：收費方式（.payment-option） */
#wizardContent .payment-option.sel {
  border-color: #0284c7 !important;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd) !important;
  font-weight: 600;
}

#wizardContent .payment-option:not(.sel) {
  border-color: #e2e8f0 !important;
  background: #fff !important;
  font-weight: normal;
}

#wizardContent .payment-option:not(.sel):hover {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
}

/* 日期時間選擇顯示 */
.dtp {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  margin: 6px 0;
  border-radius: 8px;
  border-left: 4px solid #0284c7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 13px;
}

.dtp .dt-hk-holiday {
  flex: 1 1 100%;
  order: 2;
}

.dtp > span:first-of-type {
  order: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.dtp > button {
  order: 1;
  flex: 0 0 auto;
}

.dtp button {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}

.dtp button:hover {
  background: #dc2626;
}

.dts {
  margin-top: 14px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

/* 評分選項 */
.rf-opt {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.rf {
  flex: 1;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  background: #fff;
  font-size: 13px;
}

.rf:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.rf.sel {
  border-color: #0284c7;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  font-weight: 600;
  color: #0369a1;
}

/* 搜尋框 */
.sb {
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
}

.sb input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.sb input:focus {
  border-color: #0284c7;
  outline: none;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
}

/* 圖片上傳 */
.img-up {
  border: 2px dashed #cbd5e1;
  padding: 18px;
  text-align: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.img-up:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.img-prev {
  max-width: 120px;
  max-height: 120px;
  margin: 10px auto;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 詳情顯示 */
.dtl-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.dtl-lbl {
  font-weight: 600;
  min-width: 110px;
  color: #334155;
}

/* 儲存空間進度條 */
.storage-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  margin-top: 6px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, #10b981, #059669);
}

/* 自定義時間選擇 */
.custom-time-row {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.custom-time-inner {
  flex: 1;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-custom-time {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  padding: 10px 14px;
  width: auto;
  margin-top: 0;
}

/* 教練專長選擇器 */
.spec-option {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  overflow: hidden;
}

.spec-option:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.spec-option label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  font-weight: 500;
  color: #334155;
}

.spec-option input[type="checkbox"] {
  margin: 0;
  min-width: 18px;
  height: 18px;
  accent-color: #0284c7;
}

.spec-option:has(input:checked) {
  background: #e0f2fe;
  border-color: #0284c7;
}

.spec-option input:checked + span {
  font-weight: 700;
  color: #0284c7;
}

/* 狀態選擇器 */
.status-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  text-align: center;
  min-height: 70px;
}

.status-option:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-2px);
}

.status-option strong {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  margin-bottom: 4px;
}

.status-option small {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}

/* 儀表板圖表 */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

/* 通告樣式 */
.notice-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.notice-actions .btn {
  flex: 1;
  min-width: 120px;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E) !important;
}

/* 快速通告卡片 */
.quick-notice-card {
  transition: all 0.3s ease;
  background: #fff;
}

.quick-notice-card:hover {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.15);
}

/* 範本項目 */
.template-item {
  transition: all 0.3s ease;
  background: #fff;
}

.template-item:hover {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.15);
}

.template-item h4 {
  margin: 0 0 8px 0;
  color: #0284c7;
  font-size: 15px;
  font-weight: 600;
}

.template-item p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.quick-notice-card h4 {
  margin: 0 0 6px 0;
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
}

.quick-notice-card p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

/* 通告歷史 */
.notice-history-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.notice-history-item:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.1);
}

.notice-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.notice-history-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
}

.notice-history-date {
  font-size: 12px;
  color: #94a3b8;
}

.notice-history-content {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 10px;
}

.notice-history-recipient {
  font-size: 12px;
  color: #0284c7;
  font-weight: 600;
}

/* 捲動條樣式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0284c7, #0369a1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0369a1;
}

/* ═══ 系統管理頁（與 index.html #sysmgmt 對應）═══ */
.body .pane:not(.sysmgmt-page) > h2:first-child {
  margin: 0 0 22px 0 !important;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.sysmgmt-data-panel {
  scroll-margin-top: 16px;
  margin-bottom: 32px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 10px 24px -8px rgba(2, 132, 199, 0.12);
}

.sysmgmt-data-panel__head {
  position: relative;
  padding: 22px 24px 20px;
  background: var(--sw-gradient-hdr);
  color: var(--sw-text-on-hdr);
  overflow: hidden;
  border-bottom: 1px solid var(--sw-border);
}

.sysmgmt-data-panel__head::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -8%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.sysmgmt-data-panel__head-inner {
  position: relative;
  z-index: 1;
}

.sysmgmt-data-panel__title {
  margin: 0 0 8px 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sysmgmt-data-panel__title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  font-size: 1.1rem;
}

.sysmgmt-data-panel__desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--sw-text-muted);
  max-width: 52ch;
}

.sysmgmt-data-panel__body {
  padding: 20px 20px 22px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.sysmgmt-data-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* 隱藏檔案輸入，由「匯入資料」按鈕觸發 */
.sysmgmt-backup-in {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sysmgmt-action {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.sysmgmt-action:hover {
  transform: translateY(-2px);
  border-color: #bae6fd;
  box-shadow:
    0 8px 20px -6px rgba(2, 132, 199, 0.2),
    0 4px 12px -4px rgba(15, 23, 42, 0.08);
}

.sysmgmt-action:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(14, 165, 233, 0.35),
    0 8px 20px -6px rgba(2, 132, 199, 0.15);
}

.sysmgmt-action:active {
  transform: translateY(0);
}

.sysmgmt-action__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.35rem;
  line-height: 1;
  background: linear-gradient(145deg, #e0f2fe 0%, #bae6fd 100%);
  border: 1px solid #7dd3fc;
}

.sysmgmt-action--export .sysmgmt-action__icon {
  background: linear-gradient(145deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #86efac;
}

.sysmgmt-action--import .sysmgmt-action__icon {
  background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fcd34d;
}

.sysmgmt-action--danger .sysmgmt-action__icon {
  background: linear-gradient(145deg, #fee2e2 0%, #fecaca 100%);
  border-color: #fca5a5;
}

.sysmgmt-action--danger {
  border-color: #fecaca;
}

.sysmgmt-action--danger:hover {
  border-color: #f87171;
  box-shadow:
    0 8px 20px -6px rgba(239, 68, 68, 0.18),
    0 4px 12px -4px rgba(15, 23, 42, 0.08);
}

.sysmgmt-action__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sysmgmt-action__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.sysmgmt-action__hint {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.sysmgmt-data-footnote {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.06);
  border: 1px dashed #7dd3fc;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
}

.sysmgmt-data-footnote strong {
  color: #0369a1;
}

@media (max-width: 480px) {
  .sysmgmt-data-panel__head {
    padding: 18px 16px 16px;
  }

  .sysmgmt-data-panel__body {
    padding: 16px;
  }

  .sysmgmt-data-actions {
    grid-template-columns: 1fr;
  }
}

.sysmgmt-page {
  max-width: 1100px;
  margin: 0 auto;
}

.sysmgmt-page__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e2e8f0;
}

.sysmgmt-page__title {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.sysmgmt-page__lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #64748b;
  max-width: 36rem;
}

.sysmgmt-page__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sysmgmt-page__pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0369a1;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.sysmgmt-page__pill:hover {
  background: #fff;
  border-color: #0284c7;
  color: #0c4a6e;
  transform: translateY(-1px);
}

.sysmgmt-page__pill:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
}

.sysmgmt-section {
  scroll-margin-top: 16px;
  margin-bottom: 28px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 6px 20px -8px rgba(2, 132, 199, 0.08);
  overflow: hidden;
}

.sysmgmt-section__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.sysmgmt-section__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.sysmgmt-section__titles {
  min-width: 0;
}

.sysmgmt-section__title {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.sysmgmt-section__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #64748b;
  max-width: 52ch;
}

.sysmgmt-section__body {
  padding: 20px 22px 24px;
  background: #fff;
}

.sysmgmt-course-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.sysmgmt-btn-add {
  padding: 10px 20px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.sysmgmt-filters {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  margin-bottom: 20px !important;
}

.sysmgmt-filters label {
  color: #334155 !important;
  font-size: 0.8rem !important;
}

.sysmgmt-filters input,
.sysmgmt-filters select {
  border-color: #cbd5e1 !important;
  border-radius: 8px !important;
}

.sysmgmt-course-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)) !important;
  gap: 18px !important;
}

.sysmgmt-course-grid .course-card {
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sysmgmt-course-grid .course-card:hover {
  box-shadow: 0 10px 28px -8px rgba(2, 132, 199, 0.15);
  transform: translateY(-2px);
}

.sysmgmt-page > .sysmgmt-section:last-of-type {
  margin-bottom: 12px;
}

/* 教練 Modal：目前 index.html 已使用這些 class，但正式 main.css 缺少定義 */
.mc.coach-modal-shell {
  display: flex;
  flex-direction: column;
}

.coach-modal-body {
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding: 0 4px 8px 0;
  -webkit-overflow-scrolling: touch;
}

.coach-tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

#coachModal .tab-btn {
  flex: 1;
  padding: 10px 6px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: #f8f9fa;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.3;
  min-height: 42px;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

#coachModal .tab-btn:hover {
  background: #eef2f7;
  color: #0f172a;
}

#coachModal .tab-btn.active {
  background: var(--sw-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25);
}

#coachModal .tab-content {
  color: #0f172a;
}

.coach-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 0 4px;
  margin-top: 4px;
  border-top: 1px solid #e9ecef;
  background: #fff;
  position: sticky;
  bottom: 0;
}

.coach-modal-footer .btn {
  width: auto;
  margin-top: 0;
}

.kbd-hint {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 1px;
  font-size: 10px;
  font-family: inherit;
  background: #eef2f7;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  vertical-align: middle;
}

.coach-form-card {
  background: #f8f9fa;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.coach-form-micro {
  margin: 0;
  font-size: 11px;
  color: #6c757d;
  line-height: 1.4;
}

.coach-form-optional {
  margin-top: 6px;
  border-radius: 8px;
}

.coach-form-optional > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-primary);
  padding: 8px 4px;
  list-style: none;
}

.coach-form-optional > summary::-webkit-details-marker {
  display: none;
}

.coach-form-optional[open] > summary {
  margin-bottom: 0;
}

.coach-specialty-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 2px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.coach-specialty-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.coach-specialty-title {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}

.coach-specialty-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--sw-primary);
  background: linear-gradient(180deg, #e0f2fe, #dbeafe);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  white-space: nowrap;
}

.coach-specialty-hint {
  margin: 8px 0 14px 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}

.coach-specialty-group {
  margin-bottom: 16px;
}

.coach-specialty-group:last-child {
  margin-bottom: 0;
}

.coach-specialty-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 8px;
}

.coach-specialty-chips {
  display: grid;
  gap: 8px;
}

.coach-specialty-chips--strokes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 520px) {
  .coach-specialty-chips--strokes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.coach-specialty-chips--teach {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

label.spec-option.coach-spec-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0;
  min-height: 48px;
  box-sizing: border-box;
  border-width: 2px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.coach-spec-chip__icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.coach-spec-chip__text {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  flex: 1;
  line-height: 1.3;
}

.spec-option.coach-spec-chip:has(input:checked) .coach-spec-chip__text {
  color: #0369a1;
  font-weight: 700;
}

.spec-option.coach-spec-chip input:checked + .coach-spec-chip__icon {
  font-weight: normal;
  color: inherit;
}

.coach-spec-chip--wide {
  min-height: 50px;
}

.coach-price-compact {
  display: grid;
  grid-template-columns: 1fr minmax(88px, 112px);
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.coach-price-compact:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.coach-price-compact label {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.coach-price-compact input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  text-align: right;
}

.sysmgmt-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
}

.sysmgmt-empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.85;
}

.sysmgmt-empty-state--warn {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

@media (max-width: 640px) {
  .sysmgmt-page__hero {
    flex-direction: column;
    align-items: stretch;
  }

  .sysmgmt-page__quick {
    justify-content: flex-start;
  }

  .sysmgmt-section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 文字反白可讀性：避免白底白字 */
::selection {
  background: #dbeafe;
  color: #0f172a;
}

::-moz-selection {
  background: #dbeafe;
  color: #0f172a;
}

/* ========== 全站統一：頁面標題、說明、卡片、面板、AI 狀態 ========== */
.pane-page__title,
.students-page__title,
.coaches-page__title,
.booking-page__title,
.students-progress__title,
.sched-subsection__title,
.pane h2 {
  font-size: var(--sw-font-page-title);
  font-weight: 700;
  color: var(--sw-primary-deep);
  letter-spacing: 0.02em;
  margin: 0 0 var(--sw-space-2);
  line-height: 1.3;
}

.pane-page__lead,
.students-page__lead,
.coaches-page__lead,
.booking-page__lead,
.dashboard-lcsd__lead,
.sysmgmt-page__lead {
  font-size: var(--sw-font-md);
  line-height: 1.45;
  color: var(--sw-text-subtle);
  margin: 0 0 var(--sw-space-3);
}

.sw-panel-card,
.student-list-container,
.coach-list-container,
.info-weather-card,
.info-lcsd-card {
  background: var(--sw-card-bg);
  border: var(--sw-card-border);
  border-radius: var(--sw-card-radius);
  box-shadow: var(--sw-shadow-card);
}

.sw-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sw-space-3);
  margin-bottom: var(--sw-space-3);
}

.sw-page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sw-space-2);
  align-items: center;
}

/* 全站 AI 狀態列（證書、進度、課堂紀錄等共用） */
.sw-ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--sw-font-sm);
  color: var(--sw-ai-muted);
  margin-left: var(--sw-space-2);
}

.sw-ai-status--busy::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid var(--sw-border-strong);
  border-top-color: var(--sw-primary);
  border-radius: 50%;
  animation: sw-ai-spin 0.7s linear infinite;
}

.sw-ai-status--ok {
  color: var(--sw-ai-ok);
}

.sw-ai-status--warn {
  color: var(--sw-ai-warn);
}

.sw-ai-status--err {
  color: var(--sw-ai-err);
}

@keyframes sw-ai-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sw-ai-status--busy::before {
    animation: none;
    opacity: 0.6;
  }
}

/* ========== 全站淺色工具列／篩選面板（對齊預約 bk-accordion-shell） ========== */
.sw-light-toolbar,
.student-control-panel,
.coaches-page__filters-wrap,
.coach-control-panel,
.attendance-control-panel,
.sw-panel,
.schedule-controls,
#notices .quick-notice-section,
.confirmations-filter-panel,
.confirmations-workspace .attendance-control-panel,
.booking-wizard.wz-shell:not(.bk-accordion-shell) {
  background: var(--sw-gradient-panel) !important;
  border: var(--sw-toolbar-border) !important;
  box-shadow: var(--sw-toolbar-shadow) !important;
  color: var(--sw-text);
}

.student-control-panel,
.coaches-page__filters-wrap,
.coach-control-panel,
.attendance-control-panel,
.schedule-controls,
#notices .quick-notice-section {
  padding: var(--sw-space-5);
  border-radius: var(--sw-card-radius);
  margin-bottom: var(--sw-space-5);
}

.student-filter-label,
.coach-filter-label,
.attend-filter-label,
.schedule-controls .control-group label,
.confirmations-filter-panel label {
  color: var(--sw-text-on-panel) !important;
  font-weight: 600;
}

.student-filter-select,
.student-filter-input,
.coach-filter-select,
.coach-filter-input,
.attend-filter-input,
.attend-filter-select,
.schedule-controls .control-group select,
.schedule-controls .control-group input {
  background: var(--sw-surface) !important;
  color: var(--sw-text) !important;
  border: 1px solid var(--sw-border-strong) !important;
}

.btn-student-tool,
.btn-coach-tool,
.btn-att-tool {
  box-shadow: var(--sw-shadow-sm);
}

/* 統計卡 header（學生／教練頁）改淺色 */
.student-stat-card__header,
.coach-stat-card__header {
  background: var(--sw-gradient-panel-soft) !important;
  color: var(--sw-text-on-hdr) !important;
  border-bottom: 1px solid var(--sw-border);
}
