/* 學生管理 + 游泳進度（與教練頁視覺一致） */

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

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

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

.students-page__title {
  margin: 0 0 6px 0;
  font-size: var(--sw-font-page-title);
  font-weight: 700;
  color: var(--sw-primary-deep);
}

.students-page__lead {
  margin: 0;
  font-size: var(--sw-font-md);
  color: var(--sw-text-subtle);
  line-height: 1.5;
  max-width: 52rem;
}

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

/* 面板樣式見 main.css .sw-light-toolbar */
.student-control-panel,
.coaches-page__filters-wrap {
  padding: var(--sw-space-5);
  border-radius: var(--sw-card-radius);
  margin-bottom: var(--sw-space-5);
}

.student-filters-grid {
  display: grid;
  gap: 14px 16px;
  margin-bottom: 14px;
}

.student-filters-grid--primary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1200px) {
  .student-control-panel .student-filters-grid--primary {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .student-filters-grid--primary .student-filter-field {
    flex: 0 0 min(160px, 28vw);
    min-width: 132px;
  }
}

@media (max-width: 640px) {
  /* 窄螢改直向堆疊，避免與主導航同時多層橫向捲動 */
  .student-control-panel .student-filters-grid--primary {
    display: grid;
    grid-template-columns: 1fr;
    flex-wrap: unset;
    overflow-x: visible;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .student-filters-grid--primary .student-filter-field {
    flex: unset;
    min-width: 0;
    width: 100%;
  }
}

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

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

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

.student-actions-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.student-toolbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-student-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-student-tool:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  filter: brightness(1.05);
}

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

/* 紀錄中心分頁／套用篩選：須有底色（.btn-student-tool 預設僅白字無背景） */
.btn-student-tool--pager {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 116, 144, 0.35);
}
.btn-student-tool--pager:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
  transform: none;
  opacity: 0.9;
}
.btn-student-tool--pager:disabled:hover {
  transform: none;
  box-shadow: none;
}

.sw-log-pager-meta {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.02em;
}

/* 紀錄中心：篩選欄單列排列，窄螢幕橫向捲動 */
.sw-log-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-gutter: stable;
}
.sw-log-filter-row label {
  flex: 0 0 auto;
  font-size: 12px;
  color: #475569;
}
.sw-log-filter-input {
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  box-sizing: border-box;
}
.sw-log-filter-input--datetime {
  min-width: 168px;
  max-width: 200px;
}
.sw-log-filter-input--q {
  min-width: 140px;
  width: 150px;
}
.sw-log-filter-input--user {
  min-width: 110px;
  width: 120px;
}
.sw-log-filter-input--action {
  min-width: 110px;
  width: 128px;
}
.sw-log-filter-input--level {
  min-width: 96px;
  width: 104px;
}
.sw-log-filter-apply {
  flex: 0 0 auto;
  align-self: flex-end;
  white-space: nowrap;
}

.students-search-wrap {
  margin-bottom: 20px;
}

.students-search-input {
  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;
}

.students-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 注入） */
.student-stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

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

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

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

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

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

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

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

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

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

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

.students-page__stats--compact-host .student-stat-card {
  padding: 10px 12px;
}

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

.students-page__stats--compact-host .student-stat-card__val {
  font-size: 20px;
}

.students-page__stats--compact-host .student-stat-card__label {
  font-size: 12px;
}

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

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

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

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

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

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

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

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

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

.student-table td select {
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
}

.student-table td select:focus {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

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

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

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

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

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

/* 操作欄：四顆圖示 + 下方說明（綠色＝編輯）單列顯示，避免換成 2×2 看不到標籤 */
.student-table tbody td.student-td--center {
  min-width: 240px;
  vertical-align: top;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* 避免把 table cell 變成 flex，造成操作欄底線顯示異常 */
.student-table td.abs {
  display: table-cell;
}

.student-table td.abs .bs {
  margin-right: 4px;
}

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

.student-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;
}

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

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

/* 學生管理「學生列表」：姓名欄較窄、表頭與姓名文字左緣對齊（略過頭像寬度） */
#students .student-list-container .student-table thead th.th-student-name {
  text-align: left;
  width: 1%;
  max-width: 168px;
  min-width: 112px;
  padding-left: calc(12px + 36px + 8px);
  padding-right: 8px;
  white-space: nowrap;
}

#students .student-list-container .student-table .student-td--name {
  width: 1%;
  max-width: 168px;
  min-width: 112px;
  padding-top: 12px;
  padding-bottom: 12px;
  padding-right: 8px;
  vertical-align: middle;
}

#students .student-list-container .student-table .student-td--name .student-identity {
  align-items: center;
  gap: 8px;
}

#students .student-list-container .student-table .student-td--name .student-name-block {
  min-width: 0;
  flex: 1 1 auto;
}

#students .student-list-container .student-table .student-td--name .student-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  font-size: 14px;
}

#students .student-list-container .student-table .student-td--name .student-name-block__title {
  text-align: left;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

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

/* 學生列表「聯絡方式」電話：連續顯示，避免窄欄 word-break 把數字拆行而看似「逐字空白」 */
.student-contact-line--tel {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.student-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.student-badge {
  padding: 4px 10px;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* 預約確認狀態：點擊進入學生詳情（與 📊 詳情鈕相同） */
button.student-badge.student-badge--click {
  cursor: pointer;
  border: none;
  font: inherit;
  color: inherit;
  line-height: inherit;
  -webkit-tap-highlight-color: transparent;
}
button.student-badge.student-badge--click:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}
button.student-badge.student-badge--click:hover {
  filter: brightness(1.06);
}

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

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

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

.student-metric__val--cyan {
  color: #0891b2;
}

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

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

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

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

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

.btn-student-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-student-act:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

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

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

/* ─── 游泳進度區塊 ─── */
.students-progress-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 2px solid #e2e8f0;
}

.students-progress__head {
  margin-bottom: 18px;
}

.students-progress__head--compact {
  margin-bottom: 10px;
}

.students-progress__head--compact .students-progress__hint {
  font-size: 13px;
}

.students-progress__title {
  margin: 0 0 6px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.students-progress__hint {
  margin: 0;
  font-size: 14px;
  color: #0284c7;
  font-weight: 500;
}

.students-progress__cards {
  margin-bottom: 18px;
}

/* 今日教學總結入口 */
.students-progress__today-summary-wrap {
  margin-bottom: 12px;
}

.students-progress__today-summary-wrap .sw-today-summary-btn {
  justify-content: center;
}

html.sw-mobile-ui .students-progress__today-summary-wrap .sw-today-summary-btn {
  width: 100%;
}

.today-summary-disclaimer {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 12px 0;
}

.today-summary-modal__actions {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.progress-suggest-summary--daily {
  color: #0369a1;
  font-weight: 500;
}

.progress-card--has-lesson-today {
  border-left: 3px solid #38bdf8;
}

.progress-row--lesson-today .progress-suggest-summary--daily {
  font-weight: 500;
}

.progress-row--focus,
.progress-card.progress-row--focus {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.progress-toolbar__pool-filter {
  max-width: 12rem;
}

.progress-toolbar__next-pending,
.progress-toolbar__next-pending-pool,
.progress-toolbar__pending-badge {
  white-space: nowrap;
}

.progress-toolbar__pending-badge {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
  font-weight: 600;
}

.progress-toolbar__pending-badge:hover {
  background: #ffedd5;
}

.progress-toolbar__after-class-badge {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
  font-weight: 600;
  white-space: nowrap;
}

.progress-toolbar__after-class-badge:hover {
  background: #ffedd5;
}

.progress-toolbar__after-class-badge[hidden] {
  display: none !important;
}

.progress-today-slot {
  font-size: 11px;
  color: #0369a1;
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.35;
}

.progress-card__name .progress-today-slot {
  flex: 1 1 100%;
  margin-top: 4px;
}

.progress-name-cell strong {
  display: inline;
}

.progress-toolbar__today-hint {
  font-size: 12px;
  color: #0369a1;
  align-self: center;
  flex: 1 1 100%;
}

@media (min-width: 720px) {
  .progress-toolbar__today-hint {
    flex: 0 1 auto;
  }
}

.progress-pending-note-badge,
.progress-session-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

.progress-session-badge--done {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.progress-session-badge--after {
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.progress-session-badge--pending {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
}

.progress-pending-note-badge {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
}

.today-suggestion-card__badge--pending {
  color: #b45309;
  background: #fffbeb;
}

.today-suggestion-card__actions {
  margin-top: 8px;
}

.today-suggestion-summary__meta--pending {
  color: #b45309;
  font-weight: 500;
}

.today-suggestion-card__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.progress-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.progress-toolbar__search {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
}

.progress-toolbar__search:focus {
  outline: none;
  border-color: #0284c7;
  background: #fff;
}

.progress-toolbar__level {
  min-width: 180px;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
}

.progress-toolbar__level:focus {
  outline: none;
  border-color: #0284c7;
}

.progress-list-container .progress-table-wrap.tbl-wrap,
.student-list-container + .students-progress-section .progress-table-wrap.tbl-wrap {
  margin-top: 0;
}

.students-progress-section .progress-table-wrap.tbl-wrap {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e2e8f0;
}

.progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.progress-table thead {
  background: #f1f5f9;
}

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

.progress-table th.th-stars {
  min-width: 118px;
}

.progress-table th.th-level {
  width: 100px;
}

.progress-table th.th-name {
  min-width: 100px;
  width: 11%;
}

.progress-table th.th-sen {
  min-width: 120px;
  width: 14%;
  text-align: left;
}

.progress-table th.th-sen-focus {
  min-width: 160px;
  width: 26%;
}

.progress-table th.th-suggest {
  min-width: 180px;
}

.progress-table th.th-actions {
  min-width: 220px;
  width: 220px;
  text-align: center;
}

/* 進度列表精簡：級別／四式／更新在詳細評估；課堂重點常駐並排在姓名之後 */
.progress-table--compact-list {
  table-layout: fixed;
}

.progress-table--compact-list th,
.progress-table--compact-list td {
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}

.progress-table--compact-list th.progress-col-detail,
.progress-table--compact-list td.progress-col-detail {
  display: none;
}

.progress-table--compact-list th.th-name,
.progress-table--compact-list td.progress-name-cell {
  width: 13%;
  min-width: 110px;
}

.progress-table--compact-list th.th-sen-focus,
.progress-table--compact-list td.progress-focus-cell {
  width: 14%;
  min-width: 90px;
}

.progress-table--compact-list th.th-sen,
.progress-table--compact-list td.progress-sen-cell {
  width: 16%;
  min-width: 130px;
  max-width: 220px;
}

.progress-table--compact-list th.th-suggest,
.progress-table--compact-list td.progress-suggest-cell {
  width: 33%;
  min-width: 220px;
}

.progress-table--compact-list th.th-actions,
.progress-table--compact-list td.progress-actions-cell {
  width: 204px;
}

.progress-table--compact-list .progress-focus-cell {
  max-width: none;
  white-space: normal;
  line-height: 1.45;
  word-break: break-word;
}

.progress-table--compact-list .progress-focus-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.progress-table--compact-list .progress-focus-cell--empty {
  color: #cbd5e1;
}

.progress-table--compact-list .progress-sen-type {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.progress-table--compact-list .progress-suggest-summary {
  flex: 1 1 auto;
  max-width: none;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  line-height: 1.3;
  word-break: break-word;
}

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

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

.progress-table tbody td {
  padding: 12px 10px;
  vertical-align: middle;
}

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

.progress-level-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  max-width: 100%;
  background: #f1f5f9;
  color: #0f172a;
}

.progress-level-select:focus {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

.progress-level-select--beginner { background: #e2e8f0; }
.progress-level-select--intermediate { background: #bae6fd; }
.progress-level-select--advanced { background: #fef08a; }

.progress-quick-star {
  cursor: pointer;
  font-size: 16px;
  margin: 0 1px;
  user-select: none;
  transition: transform 0.1s ease;
}

button.progress-quick-star {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
}

.progress-quick-star:hover {
  transform: scale(1.12);
}

.progress-quick-star.filled {
  color: #f59e0b;
}

.progress-quick-star:not(.filled) {
  color: #cbd5e1;
}

.progress-actions-cell {
  text-align: center;
  vertical-align: middle;
  padding-top: 8px;
  padding-bottom: 8px;
}

.progress-actions-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 6px;
  justify-content: center;
  align-items: start;
  max-width: 212px;
  margin: 0 auto;
}

.progress-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  gap: 2px;
}

.progress-action-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  line-height: 1.15;
  text-align: center;
  max-width: 64px;
}

.progress-action-icon-btn {
  min-width: 34px;
  min-height: 34px;
  padding: 5px 7px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px !important;
  line-height: 1;
  margin: 0 !important;
}

.progress-sen-cell {
  font-size: 12px;
  vertical-align: middle;
  text-align: left;
  min-width: 200px;
  max-width: 280px;
  line-height: 1.35;
}

.progress-sen-cell .progress-sen-type {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  max-width: 100%;
}

.progress-sen-badge {
  display: inline-block;
  background: #ea580c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.progress-sen-type {
  color: #475569;
  font-size: 11px;
  vertical-align: middle;
}

.progress-sen-dash {
  color: #94a3b8;
}

.progress-focus-cell {
  font-size: 12px;
  color: #334155;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.progress-card__line--focus .progress-card__v {
  line-height: 1.45;
  word-break: break-word;
}

.progress-suggest-cell {
  font-size: 12px;
  vertical-align: middle;
  max-width: 280px;
  line-height: 1.35;
}

.progress-table--compact-list .progress-suggest-cell {
  display: table-cell;
  max-width: none;
}

.progress-table--compact-list .progress-suggest-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.progress-suggest-summary {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  color: #475569;
}

.progress-table--compact-list .progress-suggest-summary {
  flex: 1 1 auto;
  max-width: none;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  text-overflow: clip;
  line-height: 1.3;
  word-break: break-word;
}

.progress-suggest-detail-btn {
  padding: 4px 8px !important;
  font-size: 11px !important;
  margin: 0 !important;
  vertical-align: middle;
}

.progress-table--compact-list .progress-suggest-detail-btn {
  padding: 3px 8px !important;
  line-height: 1.2;
  flex-shrink: 0;
}

/* 覆蓋一般欄位規則，避免被後段通用樣式壓掉導致不對齊 */
.progress-table--compact-list td.progress-focus-cell {
  max-width: none;
  white-space: normal;
}

.progress-table--compact-list td.progress-sen-cell {
  min-width: 130px;
  max-width: 220px;
}

.progress-table--compact-list td.progress-suggest-cell {
  min-width: 220px;
}

.progress-table--compact-list tbody td {
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}

.progress-suggestion-disclaimer {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 12px 0;
}

.progress-suggestion-body {
  max-height: 28vh;
  overflow-y: auto;
  padding-right: 4px;
}

.progress-sug-context {
  margin: 0 0 4px 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.progress-sug-context__lead {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px 0;
  line-height: 1.45;
}

.progress-sug-context__line {
  font-size: 13px;
  color: #0f172a;
  margin: 0;
  line-height: 1.5;
}

.progress-minimax-ai__actions {
  align-items: center;
}

.progress-minimax-ai__anon {
  font-size: 13px;
  color: #334155;
}

.progress-sug-sec {
  margin-bottom: 14px;
}

.progress-sug-sec--sen {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
}

.progress-sug-h {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #0f172a;
}

.progress-sug-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.progress-suggestion-prompt {
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

.progress-minimax-ai {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.progress-minimax-ai__meta {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px 0;
}

.progress-minimax-ai__body {
  max-height: 36vh;
  overflow-y: auto;
  margin-bottom: 10px;
}

.progress-minimax-next {
  font-size: 13px;
  color: #0f172a;
  margin: 8px 0 0 0;
}

.progress-quick-session-disclaimer,
.progress-quick-session-student {
  font-size: 13px;
  color: #475569;
  margin: 0 0 10px 0;
}

.progress-quick-session-voice-status {
  font-size: 12px;
  color: #64748b;
  align-self: center;
}

.progress-quick-session-auto-next {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.progress-quick-session-auto-next input {
  width: 1rem;
  height: 1rem;
}

.progress-actions-cell .bs {
  margin: 0;
}

.progress-updated-cell {
  font-size: 12px;
  color: #64748b;
}

/* 寬度 ≤1200px 仍顯示表格時（例如偏好桌面版）：提示橫向捲動並固定操作欄 */
@media (max-width: 1200px) {
  #progress:not(.sw-progress-card-shell) .progress-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-padding-right: 12rem;
  }

  #progress:not(.sw-progress-card-shell) .progress-table-wrap::before {
    content: '← 左右滑動可查看「智能建議」「操作（證書）」等欄位 →';
    display: block;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    padding: 8px 10px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
  }

  #progress:not(.sw-progress-card-shell) .progress-table thead th.th-actions,
  #progress:not(.sw-progress-card-shell) .progress-table td.progress-actions-cell {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
    box-shadow: -6px 0 10px rgba(15, 23, 42, 0.06);
  }

  #progress:not(.sw-progress-card-shell) .progress-table thead th.th-actions {
    background: #f1f5f9;
  }
}
