/* panes_attendance_schedule — 點名／課程表（由 panes.css 拆出） */
/* ─── 點名／課程表：淺色控制面板（見 main.css .sw-light-toolbar） ─── */
.attendance-control-panel,
.sw-panel {
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
}

/* 統一篩選格線 - 單列顯示（與學生頁一致） */
.attend-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 16px;
  margin-bottom: 18px;
}

.attend-filter-field {
  display: flex;
  flex-direction: column;
}

.attend-filter-label {
  display: block;
  color: var(--sw-text-on-panel);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.attend-filter-input,
.attend-filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sw-border-strong);
  border-radius: 10px;
  background: var(--sw-surface);
  color: var(--sw-text);
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--sw-shadow-sm);
}

.attend-filter-input:focus,
.attend-filter-select:focus {
  outline: 2px solid var(--sw-primary);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .attend-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .attend-filters-grid {
    grid-template-columns: 1fr;
  }
}

/* 統一批次操作按鈕列 */
.attend-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-att-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-att-tool:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  filter: brightness(1.08);
}

.btn-att-tool__icon {
  font-size: 15px;
  line-height: 1;
}

.btn-att-tool__label {
  font-size: 13px;
}

.btn-att-tool--success { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-att-tool--warn { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.btn-att-tool--danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.btn-att-tool--export { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.btn-att-tool--analytics { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

.attend-filters-more {
  margin: 10px 0 8px;
}

.attend-filters-grid--more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding-bottom: 10px;
}

.attend-toolbar-more {
  position: relative;
  display: inline-flex;
}

.attend-toolbar-more__sum {
  list-style: none;
  cursor: pointer;
  background: #64748b;
}

.attend-toolbar-more__sum::-webkit-details-marker {
  display: none;
}

.attend-toolbar-more__panel {
  position: absolute;
  z-index: 40;
  right: 0;
  top: calc(100% + 4px);
  min-width: 168px;
  padding: 6px;
  background: var(--sw-surface, #fff);
  border: 1px solid var(--sw-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attend-toolbar-more__item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.attend-toolbar-more__item:hover {
  background: #e2e8f0;
}

@media (max-width: 640px) {
  .attend-filters-grid--more {
    grid-template-columns: 1fr;
  }
}

/* ─── 課程表管理篩選列 ─── */
.sched-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 16px;
  margin-bottom: 16px;
}

.sched-filter-field {
  display: flex;
  flex-direction: column;
}

.sched-filter-label {
  display: block;
  color: var(--sw-text-on-panel);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.sched-filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sw-border-strong);
  border-radius: 10px;
  background: var(--sw-surface);
  color: var(--sw-text);
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--sw-shadow-sm);
}

.sched-options-bar,
.sched-week-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.sched-option-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sw-text-on-panel);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}

.sched-week-nav {
  display: flex;
  gap: 8px;
}

.sched-week-nav .btn {
  padding: 8px 16px;
  font-size: 13px;
}

.pane-panel-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.pane-panel-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.pane-panel-check input {
  width: 18px;
  height: 18px;
}

.pane-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-pane-tool {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-pane-tool:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  filter: brightness(1.05);
}

.btn-pane-tool--success { background: #16a34a; }
.btn-pane-tool--warn { background: #ea580c; }
.btn-pane-tool--danger { background: #dc2626; }
.btn-pane-tool--info { background: #2563eb; }
.btn-pane-tool--purple { background: #7c3aed; }

.quick-attend-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.att-leave-panel {
  margin-top: 12px;
}

.att-leave-fee-policy {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--sw-border, #e2e8f0);
  border-radius: 8px;
  background: var(--sw-surface-muted, #f8fafc);
}

.att-leave-fee-policy__title {
  display: block;
  font-size: 13px;
  color: var(--sw-text, #0f172a);
  margin-bottom: 4px;
}

.att-leave-fee-policy__hint,
.att-leave-fee-policy__meta,
.att-leave-fee-policy__note {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--sw-text-muted, #64748b);
}

.att-leave-fee-policy__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 6px;
  font-size: 13px;
  color: var(--sw-text, #0f172a);
  cursor: pointer;
}

.att-leave-fee-policy__check input {
  margin-top: 2px;
}

.fin-adj-policy {
  display: inline-block;
  margin-top: 2px;
  color: #64748b;
}

.fin-adj-policy--24h {
  color: #b45309;
  font-weight: 600;
}

.fin-adj-policy--half {
  color: #c2410c;
  font-weight: 600;
}

.fin-adj-policy--coach {
  color: #0369a1;
}

.att-modal-select,
.att-modal-textarea {
  width: 100%;
  margin-top: 5px;
}

.att-modal-textarea {
  min-height: 60px;
  padding: 8px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fff;
  resize: vertical;
  font-family: inherit;
}

.mc--wide {
  max-width: 800px;
}

.batch-student-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  margin-top: 5px;
  background: #fff;
}

.batch-att-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.batch-att-actions > .btn {
  flex: 1;
}

/* 白色列表外殼 */
.data-list-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.data-list-panel .tbl-wrap {
  margin-top: 0;
  box-shadow: none;
  border-radius: 0;
}

.data-list-panel__head {
  background: #f1f5f9;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.data-list-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.data-list-panel__hint {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.attend-page__stats {
  margin-bottom: 20px;
}

/* 統一統計卡片 - 與學生／教練頁面風格一致 */
.attendance-stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.attendance-stat-card {
  color: #fff;
  padding: 18px 16px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.2s ease;
}

.attendance-stat-card:hover {
  transform: translateY(-3px);
}

.attendance-stat-card__icon {
  font-size: 28px;
  margin-bottom: 8px;
  line-height: 1;
  opacity: 0.95;
}

.attendance-stat-card__val {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 2px;
  line-height: 1;
}

.attendance-stat-card__label {
  font-size: 13px;
  opacity: 0.95;
  font-weight: 600;
  margin-bottom: 4px;
}

.attendance-stat-card__sub {
  font-size: 12px;
  opacity: 0.75;
  font-weight: 500;
}

.attendance-stat-card--present {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

.attendance-stat-card--leave {
  background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
}

.attendance-stat-card--absent {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.attendance-stat-card--pending {
  background: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

.attend-page__stats--compact-host {
  margin-bottom: 12px;
}

.attend-page__stats--compact-host .attendance-stats-cards {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.attend-page__stats--compact-host .attendance-stat-card {
  padding: 10px 12px;
}

.attend-page__stats--compact-host .attendance-stat-card__icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.attend-page__stats--compact-host .attendance-stat-card__val {
  font-size: 22px;
}

.attend-page__stats--compact-host .attendance-stat-card__label {
  font-size: 11px;
}

.attend-page__stats--compact-host .attendance-stat-card__sub {
  font-size: 10px;
}

.attend-stats-footnote {
  margin-top: 8px !important;
  text-align: center;
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.4;
}

/* 點名表格 */
.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.attendance-table thead {
  background: #f8fafc;
}

.attendance-table th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 700;
  color: #334155;
  font-size: 13px;
  border-bottom: 2px solid #e2e8f0;
}

.attendance-table th.th-center {
  text-align: center;
}

.attendance-table th.th-actions {
  text-align: center;
  min-width: 260px;
  font-size: 13px;
}

.attendance-table tbody tr.attendance-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.attendance-table tbody tr.attendance-row:hover {
  background: #f8fafc;
}

.att-cell {
  padding: 14px 12px;
  vertical-align: middle;
  color: #334155;
}

.att-cell--center {
  text-align: center;
  vertical-align: top;
  padding-top: 18px;
  padding-bottom: 18px;
}

.att-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.att-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

img.att-avatar,
.att-avatar--photo {
  object-fit: cover;
  display: block;
  padding: 0;
  border: none;
}

.att-avatar--profile-md {
  width: 60px;
  height: 60px;
  min-width: 60px;
  font-size: 24px;
}

.att-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}

.att-sen-tag {
  font-size: 11px;
  color: #ea580c;
  margin-top: 2px;
}

.att-ai-focus {
  font-size: 11px;
  color: var(--sw-primary, #0284c7);
  margin-top: 3px;
  line-height: 1.35;
  max-width: 220px;
}

.att-metric-val {
  font-size: 14px;
  font-weight: 800;
}

.att-metric-val--green { color: #16a34a; }
.att-metric-val--orange { color: #ea580c; }
.att-metric-val--red { color: #dc2626; }
.att-metric-val--blue { color: #6366f1; }

.att-metric-hint {
  font-size: 11px;
  color: #475569;
}

.att-rate-bar {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.att-rate-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  border-radius: 2px;
}

.att-quick-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

.att-slot-kind {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: baseline;
}

.att-slot-kind--extra {
  background: #ede9fe;
  color: #6d28d9;
}

.att-slot-kind--makeup {
  background: #ccfbf1;
  color: #0f766e;
}

.att-status-pill {
  padding: 6px 14px;
  border-radius: 999px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.att-status-pill--block {
  width: 100%;
  box-sizing: border-box;
  max-width: 160px;
}

.att-status-pill--pending-confirm {
  max-width: 120px;
}

.att-confirm-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.att-confirm-badge--pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.att-row--pending-confirm {
  background: rgba(245, 158, 11, 0.04);
}

.att-row--pending-confirm .att-status-pill--pending-confirm {
  box-shadow: none;
}

.att-actions-row--pending,
.att-by-student-act-row--pending {
  justify-content: center;
  opacity: 0.92;
}

.att-pending-confirm-hint {
  display: inline-block;
  font-size: 11px;
  color: #b45309;
  font-weight: 600;
  padding: 6px 4px;
}

/* 快速操作列：統一使用單列 + 橫向捲動，避免換行遮蓋標籤 */
.att-actions-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  overflow: visible;
  max-width: 100%;
  padding-bottom: 6px;
}

.att-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 52px;
  flex-shrink: 0;
}

.att-action-label {
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  line-height: 1.1;
  text-align: center;
  max-width: 52px;
  white-space: nowrap;
}

.btn-att-act {
  flex: 0 0 auto;
  min-width: 40px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn-att-act:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-att-act--ok { background: #16a34a; }
.btn-att-act--leave { background: #ea580c; }
.btn-att-act--absent { background: #dc2626; }
.btn-att-act--detail { background: #6366f1; }
.btn-att-act--more {
  background: #64748b;
  min-width: 40px;
  list-style: none;
}

.btn-att-act--more::-webkit-details-marker {
  display: none;
}

.att-more {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.att-more[open] {
  z-index: 60;
}

.att-more > summary {
  cursor: pointer;
  list-style: none;
}

.att-more > summary::-webkit-details-marker {
  display: none;
}

/* fixed：避開表格／data-list-panel 的 overflow 裁切；開啟時 JS 會 portal 到 body */
.att-more__panel {
  position: fixed;
  z-index: 1200;
  min-width: 148px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.att-more__panel--portal {
  z-index: 2400;
  -webkit-overflow-scrolling: touch;
}

.att-more__item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.att-more__item:hover {
  background: #e2e8f0;
}

.att-more--compact .att-more__panel {
  min-width: 132px;
}

.btn-att-by-day--more {
  background: #64748b;
  color: #fff;
  min-width: 2.25rem;
}

/* 開啟時提高該列層級，減少被下一列蓋住 */
.student-table tbody tr:has(.att-more[open]),
.attendance-table tbody tr:has(.att-more[open]) {
  position: relative;
  z-index: 8;
}

.att-quick-actions,
.att-cell--center,
.student-table td.att-cell--center {
  overflow: visible;
}

.attendance-table .att-empty-row td {
  text-align: center;
  color: #94a3b8;
  padding: 40px 16px;
}

/* 依學生點名 */
.att-by-student-panel {
  margin-bottom: 20px;
}

.att-by-student-panel__head {
  margin-bottom: 12px;
}

.att-by-student-panel__title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.att-by-student-panel__hint {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.att-by-student-panel__picker {
  margin-bottom: 14px;
  max-width: 420px;
}

select.att-by-student-select {
  width: 100%;
  max-width: 420px;
}

.att-by-student-table-wrap {
  margin-top: 4px;
}

.att-by-student-table .att-by-student-act-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.att-by-student-table .btn-att-by-day {
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  transition: filter 0.15s ease;
}

.att-by-student-table .btn-att-by-day:hover {
  filter: brightness(1.06);
}

.att-by-student-table .btn-att-by-day--ok {
  background: #16a34a;
}

.att-by-student-table .btn-att-by-day--leave {
  background: #ea580c;
}

.att-by-student-table .btn-att-by-day--absent {
  background: #dc2626;
}

.att-by-student-table .btn-att-by-day--detail {
  background: #6366f1;
}

/* 學生課程管理：內嵌小節標題 */
.attend-embed-section {
  margin: 4px 0 8px;
}
.attend-embed-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.attend-embed-confirmations .sched-subsection__head {
  flex-direction: column;
  align-items: flex-start;
}
.attend-embed-confirmations .sched-subsection__head .pane-page__lead {
  max-width: 52rem;
}

/* 課程表子區 */
.sched-subsection {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
}

.sched-subsection__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.sched-subsection__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.sched-subsection__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn--sched-sub-export {
  background: #16a34a;
  color: #fff;
}
.btn--sched-sub-print {
  background: #2563eb;
  color: #fff;
}

.btn--sched-sub-gcal {
  background: #1e3a5f;
  color: #fff;
}

.btn--sched-toolbar,
.btn--compact-toolbar {
  width: auto !important;
  margin-top: 0 !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600;
  border-radius: 8px;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sw-btn-refresh {
  padding: 8px 18px;
}

.sched-btn-refresh {
  padding: 6px 12px !important;
  font-size: 12px !important;
  flex-shrink: 0;
}

/* 課程表：篩選與週次同一區，減少直向堆疊 */
.sw-panel--schedule {
  padding: 12px 14px;
  margin-bottom: 12px;
}

.sw-panel--schedule .sched-filters-grid {
  gap: 10px 12px;
  margin-bottom: 10px;
}

.sched-filters-grid--primary {
  grid-template-columns: repeat(2, minmax(0, 220px));
}

@media (max-width: 640px) {
  .sched-filters-grid--primary {
    grid-template-columns: 1fr;
  }
}

.sched-filters-more {
  margin: 0 0 10px;
}

.sched-filters-more__sen {
  align-self: end;
  min-height: 36px;
}

.sw-panel--schedule .sched-filter-label {
  margin-bottom: 4px;
  font-size: 12px;
}

.sw-panel--schedule .sched-filter-select {
  padding: 7px 10px;
  font-size: 13px;
}

.sched-controls-merge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 0;
}

.sw-panel--schedule .sched-controls-merge .btn.sw-btn-on-panel {
  width: auto !important;
  margin-top: 0 !important;
}

.sched-controls-merge .sched-option-check {
  font-size: 13px;
  margin: 0;
}

.sched-week-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  flex: 1 1 220px;
  min-width: min(100%, 280px);
}

.sched-week-inline__label {
  margin-bottom: 0 !important;
  white-space: nowrap;
}

.sched-week-inline .sched-week-select {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 420px;
}

.sched-week-nav__btn {
  padding: 6px 12px !important;
  font-size: 14px !important;
  font-weight: 700;
  min-width: 40px;
}

.sched-week-hint {
  display: none;
  flex: 1 1 100%;
  margin: 0;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.sched-week-hint--visible {
  display: block;
}

.sched-leave-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 100%;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
}

.sched-leave-legend__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #ea580c;
  flex-shrink: 0;
}

.sched-week-select {
  min-width: 120px;
}

.sched-stat-cards {
  margin-bottom: 20px;
}

.sched-stat-cards--compact.cards {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.sched-stat-cards--compact .card {
  padding: 10px 12px;
}

.sched-stat-cards--compact .card h3 {
  font-size: 11px;
  margin: 0 0 4px 0;
}

.sched-stat-cards--compact .card .val {
  font-size: 20px;
}

/* 全站統計卡緊湊列（與課程表 sched-stat-cards--compact 相同邏輯） */
.sw-stats-cards--compact.cards {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.sw-stats-cards--compact .card {
  padding: 10px 12px;
}

.sw-stats-cards--compact .card h3 {
  font-size: 11px;
  margin: 0 0 4px 0;
}

.sw-stats-cards--compact .card .val {
  font-size: 20px;
}

/* 漸層篩選面板緊湊：學生／教練／點名 */
.control-panel--compact.student-control-panel,
.control-panel--compact.coach-control-panel {
  padding: 12px 14px;
  margin-bottom: 12px;
}

.control-panel--compact .student-filters-grid,
.control-panel--compact .coach-filters-grid {
  gap: 10px 12px;
  margin-bottom: 0;
}

.control-panel--compact .student-filter-label,
.control-panel--compact .coach-filter-label {
  margin-bottom: 4px;
  font-size: 12px;
}

.control-panel--compact .student-filter-select,
.control-panel--compact .coach-filter-select {
  padding: 7px 10px;
  font-size: 13px;
}

.panel-filters-actions-merge {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-panel--compact .student-actions-bar,
.control-panel--compact .coach-actions-bar {
  margin-top: 0;
  padding-top: 2px;
  gap: 8px;
}

.control-panel--compact .btn-student-tool,
.control-panel--compact .btn-coach-tool {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.control-panel--compact .student-toolbar-item {
  gap: 2px;
}

.attendance-control-panel.control-panel--compact {
  padding: 12px 14px;
  margin-bottom: 12px;
}

.attendance-control-panel.control-panel--compact .attend-filters-grid {
  gap: 10px 12px;
  margin-bottom: 0;
}

.attendance-control-panel.control-panel--compact .attend-filter-label {
  margin-bottom: 4px;
  font-size: 12px;
}

.attendance-control-panel.control-panel--compact .attend-filter-input,
.attendance-control-panel.control-panel--compact .attend-filter-select {
  padding: 7px 10px;
  font-size: 13px;
}

.attendance-control-panel.control-panel--compact .attend-actions-bar {
  gap: 8px;
  margin-top: 0;
  padding-top: 2px;
}

.attendance-control-panel.control-panel--compact .btn-att-tool {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.attendance-control-panel.control-panel--compact .btn-att-tool__icon {
  font-size: 14px;
}

.attendance-control-panel.control-panel--compact .btn-att-tool__label {
  font-size: 12px;
}

/* 頁首／工具列緊湊 */
.pane-page__head--compact {
  margin-bottom: 12px;
}

.pane-page__head--compact .pane-page__lead {
  font-size: 13px;
  max-width: 48rem;
}

.page-head-row--compact h2 {
  margin-bottom: 4px;
}

.finance-toolbar--compact {
  margin-top: 8px;
  gap: 10px;
}

.finance-toolbar--compact .finance-billing-label,
.finance-toolbar--compact .finance-check-label,
.finance-toolbar--compact .finance-inline-label {
  font-size: 13px;
}

.finance-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.fin-filter-select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  min-width: 7rem;
}

.fin-filter-select--coach {
  min-width: 9rem;
}

.fin-filter-search {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  min-width: 10rem;
  flex: 1;
  max-width: 18rem;
}

.fin-sub-toolbar {
  font-size: 13px;
}

.fin-sub-toolbar .finance-check-label,
.fin-sub-toolbar .finance-inline-label {
  margin: 0;
}

.finance-lead--billing.finance-lead--compact {
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.notices-page__head.notices-page__head--compact {
  margin-bottom: 12px;
  align-items: center;
}

.notices-toolbar--compact {
  gap: 8px;
}

.notices-toolbar--compact .notices-toolbar-btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  margin-top: 0 !important;
  width: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.booking-page__gcal-btn--compact {
  padding: 8px 14px !important;
  font-size: 12px !important;
  border-radius: 8px;
  margin-top: 0 !important;
}

.sched-footer-actions--compact {
  margin-top: 12px;
  gap: 8px;
}

.sched-footer-actions--compact .btn {
  flex: 0 1 auto;
  min-width: 0;
  width: auto !important;
  margin-top: 0 !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
}

.students-progress-section .sw-stats-cards--compact {
  margin-bottom: 10px;
}

.progress-toolbar--compact {
  gap: 8px;
  margin-bottom: 10px;
}

.progress-toolbar--compact .progress-toolbar__search,
.progress-toolbar--compact .progress-toolbar__level {
  padding: 8px 10px;
  font-size: 13px;
}

.progress-toolbar--compact .progress-toolbar__reset-sort,
.progress-toolbar--compact .progress-toolbar__export-csv {
  flex-shrink: 0;
  white-space: nowrap;
}

.dashboard-page__head--compact {
  margin-bottom: 12px;
}

.dashboard-page__head--compact .students-page__lead {
  font-size: 13px;
}

.btn-confirm-gcal {
  background: #4285f4 !important;
  color: #fff !important;
  font-weight: 600;
  border: none;
  align-self: end;
}

.sysmgmt-page__hero--compact {
  gap: 12px;
  margin-bottom: 16px !important;
  padding-bottom: 14px !important;
}

.sysmgmt-page__hero--compact .sysmgmt-page__title {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.sysmgmt-page__hero--compact .sysmgmt-page__lead {
  font-size: 0.85rem;
  max-width: 40rem;
}

.sysmgmt-page__hero--compact .sysmgmt-page__pill {
  padding: 6px 11px;
  font-size: 0.75rem;
}

.sysmgmt-group {
  margin: 0 0 28px;
  scroll-margin-top: 12px;
}

.sysmgmt-group__head {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sw-border);
}

.sysmgmt-group__title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--sw-text);
}

.sysmgmt-group__lead {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--sw-text-muted);
}

.sysmgmt-group .sysmgmt-section,
.sysmgmt-group .sysmgmt-data-panel {
  margin-bottom: 14px;
}

.sysmgmt-group .sysmgmt-section:last-child,
.sysmgmt-group .sysmgmt-data-panel:last-child {
  margin-bottom: 0;
}

#attend .attend-list__hint {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.sched-footer-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sched-footer-actions .btn {
  flex: 1;
  min-width: 140px;
}

.btn-sched--teal { background: #0d9488 !important; color: #fff !important; }
.btn-sched--red { background: #dc2626 !important; color: #fff !important; }
.btn-sched--purple { background: #7c3aed !important; color: #fff !important; }
.btn-sched--orange { background: #ea580c !important; color: #fff !important; }

.schedule-container-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

/* 課程表：表頭與內容必須同一個 <table>，否則 Grid 與 table 欄寬無法對齊 */
.schedule-table-wrap {
  max-height: 600px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-table-unified {
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.schedule-table-unified col.schedule-col-time {
  width: 88px;
}

.schedule-table-unified col.schedule-col-day {
  width: auto;
}

.schedule-table-unified thead th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 6px;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 #e2e8f0;
}

.schedule-table-unified thead th:first-child {
  text-align: left;
}

.schedule-table-unified .sched-th-date {
  display: block;
  margin-top: 3px;
  font-weight: 600;
  font-size: 11px;
  color: #64748b;
  line-height: 1.25;
}

.schedule-table-unified tbody tr {
  background: #f8f9fa;
}

.schedule-table-unified td {
  border: 1px solid #e9ecef;
  padding: 6px 4px;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.schedule-table-unified td.sched-time-cell {
  font-weight: 600;
  color: #495057;
  font-size: 13px;
  background: #f8f9fa;
  white-space: nowrap;
}

.schedule-table-unified td.sched-day-cell {
  min-width: 0;
}

.schedule-body-scroll {
  max-height: 600px;
  overflow-y: auto;
}

.schedule-body-scroll table {
  width: 100%;
  border-collapse: collapse;
}

