/* 教練管理頁：標題、篩選面板、統計卡、列表表 */

.coaches-page__head {
  margin-bottom: 20px;
}

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

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

.coaches-page__title {
  margin: 0 0 6px 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.coaches-page__lead {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  max-width: 52rem;
}

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

/* 面板樣式見 main.css .sw-light-toolbar */
.coach-control-panel {
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.coach-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  margin-bottom: 16px;
}

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

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

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

.coach-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);
}

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

.coach-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

.btn-coach-tool--add { background: #16a34a; }
.btn-coach-tool--import { background: #ea580c; }
.btn-coach-tool--export { background: #2563eb; }
.btn-coach-tool--analytics { background: #7c3aed; }

/* 搜尋 */
.coaches-search-wrap {
  margin-bottom: 20px;
}

.coaches-search-input {
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.coaches-search-input:focus {
  outline: none;
  border-color: #0284c7;
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 統計卡（由 JS 注入 .coach-stats-cards） */
.coach-stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.coach-stat-card {
  color: var(--sw-text);
  padding: 20px;
  border-radius: 14px;
  text-align: center;
  box-shadow: var(--sw-shadow-card);
  border: 1px solid var(--sw-border);
}

.coach-stat-card__icon {
  font-size: 32px;
  margin-bottom: 10px;
  line-height: 1;
}

.coach-stat-card__val {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.1;
}

.coach-stat-card__label {
  font-size: 14px;
  opacity: 0.95;
  font-weight: 600;
}

.coach-stat-card__sub {
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.78;
  line-height: 1.35;
}

.coach-stat-card--coaches {
  background: #f0f9ff;
  border-left: 4px solid var(--sw-primary);
  color: var(--sw-text);
}

.coach-stat-card--classes {
  background: #ecfeff;
  border-left: 4px solid #06b6d4;
  color: var(--sw-text);
}

.coach-stat-card--salary {
  background: #fdf2f8;
  border-left: 4px solid #db2777;
  color: var(--sw-text);
}

.coach-stat-card--rating {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: var(--sw-text);
}

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

.coaches-page__stats--compact-host .coach-stat-card {
  padding: 10px 12px;
}

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

.coaches-page__stats--compact-host .coach-stat-card__val {
  font-size: 20px;
}

.coaches-page__stats--compact-host .coach-stat-card__label {
  font-size: 12px;
}

.coaches-page__stats--compact-host .coach-stat-card__sub {
  font-size: 11px;
  margin-top: 4px;
}

/* 列表容器 */
.coach-list-container {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

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

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

.coach-list-container .coach-table-wrap.tbl-wrap {
  margin-top: 0;
  box-shadow: none;
  border-radius: 0;
}

.coach-table-wrap {
  margin: 0;
}

.coach-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

/* 欄寬分配（與學生列表同為 8 欄：信息／聯絡／分類／時薪／專長／課堂／薪酬／操作） */
.coach-table col.coach-col--name { width: 12%; }
.coach-table col.coach-col--contact { width: 11%; }
.coach-table col.coach-col--badges { width: 10%; }
.coach-table col.coach-col--rate { width: 9%; }
.coach-table col.coach-col--spec { width: 26%; }
.coach-table col.coach-col--classes { width: 8%; }
.coach-table col.coach-col--salary { width: 9%; }
.coach-table col.coach-col--actions { width: 15%; }

.coach-table th.th-coach-spec {
  text-align: left;
}

.coach-td--spec {
  vertical-align: top;
}

.coach-td--spec .coach-spec-tags {
  max-width: 100%;
}

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

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

.coach-table th.th-num,
.coach-table th.th-center {
  text-align: center;
}

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

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

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

.coach-td--num {
  text-align: center;
}

.coach-td--center {
  text-align: center;
}

/* 操作欄（最後一欄）：三鍵圖示 + 標籤需較寬，避免擠壓 */
.coach-table tbody tr.coach-row td.coach-td--center:last-child {
  min-width: 168px;
  vertical-align: top;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 10px;
  padding-right: 10px;
}

.coach-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

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

.coach-name-block__id {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.coach-alias-cell {
  color: #475569;
  font-size: 13px;
}

.coach-alias-cell--empty {
  color: #cbd5e1;
}

.coach-contact-line {
  font-size: 13px;
  color: #475569;
}

/* 與學生列表「分類」欄同構：沿用 student-badges / student-badge */
.coach-table .student-badges {
  justify-content: flex-start;
}

.coach-spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.coach-spec-tag {
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.coach-spec-empty {
  font-size: 12px;
  color: #94a3b8;
}

.coach-metric {
  text-align: center;
}

.coach-metric__val {
  font-size: 14px;
  font-weight: 800;
  color: #0284c7;
}

.coach-metric__val--blue {
  color: #0284c7;
}

.coach-metric__val--green {
  color: #16a34a;
}

.coach-metric__val--pink {
  color: #db2777;
}

.coach-metric__hint {
  font-size: 11px;
  color: #475569;
  margin-top: 2px;
}

.coach-status-pill {
  display: inline-block;
  padding: 4px 12px;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.coach-status-reason {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  max-width: 140px;
  margin-left: auto;
  margin-right: auto;
}

.coach-actions-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.coach-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
}

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

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

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

.btn-coach-act--view { background: #6366f1; }
.btn-coach-act--edit { background: #16a34a; }
.btn-coach-act--sched { background: #ea580c; }
.btn-coach-act--del { background: #dc2626; }

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