/* 全站樣式 7/16：總表、老師課程卡片、管理學生列表、經手人卡片、點名動作條、點名卡片模式 */
/* ============================================
   總表 Dashboard
   ============================================ */
.dashboard-stats {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.dashboard-stats span {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
}

/* 匯入分頁切換 */
.import-tab {
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-secondary);
  transition: all 0.2s;
}
.import-tab.active {
  background: var(--accent);
  color: white;
}

/* ============================================
   老師課程卡片
   ============================================ */
.teacher-course-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--separator);
}

.teacher-course-card.today {
  border-left-color: var(--green);
  box-shadow: 0 2px 12px rgba(106,176,123,0.15);
}

/* 課堂時間條 */
.session-time-bar {
  display: flex;
  justify-content: space-around;
  background: rgba(106,176,123,0.08);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green);
}

/* 點名時間標籤 */
.att-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 6px;
}

/* 出缺席明細表 */
.att-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}

.att-detail-table th, .att-detail-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 0.33px solid var(--separator);
  white-space: nowrap;
}

.att-detail-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.att-detail-table .sticky-col {
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 2;
  text-align: left;
  font-weight: 500;
  min-width: 60px;
}

.att-detail-table th.sticky-col {
  background: var(--bg);
  z-index: 3;
}

.att-cell.present { color: var(--green); font-weight: 700; }
.att-cell.absent { color: var(--red); font-weight: 700; }
.att-detail-table tfoot .att-foot-row td { background: var(--bg); border-top: 1px solid var(--separator); }
.att-detail-table tfoot .att-foot-row .sticky-col { background: var(--bg); }
.att-cell.count-present { color: var(--green); font-weight: 700; background: rgba(52,199,89,0.06); }
.att-cell.count-absent { color: var(--red); font-weight: 700; background: rgba(255,59,48,0.06); }

/* 管理員點名摘要卡片 */
.att-summary-card {
  padding: 14px 16px;
  border-bottom: 0.33px solid var(--separator);
}
.att-summary-card:last-child { border-bottom: none; }

.att-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.att-summary-name {
  font-size: 1.0625rem;
  font-weight: 700;
}

.att-summary-teacher {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.att-summary-details {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 12px;
}

.att-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.8125rem;
}

.att-summary-row span:first-child {
  color: var(--text-secondary);
}

.stat-present { background: rgba(52,199,89,0.12); color: var(--green); }
.stat-late { background: rgba(255,149,0,0.12); color: var(--orange); }
.stat-absent { background: rgba(255,59,48,0.12); color: var(--red); }
.stat-rate { background: rgba(0,122,255,0.1); color: var(--accent); }

/* ============================================
   管理學生列表
   ============================================ */
.manage-student-list {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(60,40,20,.08);
}

.manage-student-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 0.33px solid var(--separator);
  gap: 10px;
}

.manage-student-row:last-child { border-bottom: none; }

.manage-student-num {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 22px;
  text-align: center;
}

.manage-student-name {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.manage-student-name:active { color: var(--accent); }

.manage-student-actions {
  display: flex;
  gap: 6px;
}

.manage-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.manage-btn.edit {
  background: rgba(0,122,255,0.1);
  color: var(--accent);
}

.manage-btn.delete {
  background: rgba(255,59,48,0.08);
  color: var(--red);
}

.manage-btn:active { opacity: 0.6; }

/* ============================================
   經手人卡片
   ============================================ */
.pc-handler-card {
  padding: 10px 18px;
  border-radius: 12px;
  border: 2px solid var(--separator);
  background: var(--card);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.pc-handler-card:active { transform: scale(0.95); }

.pc-handler-card.selected {
  border-color: var(--orange);
  background: rgba(255,149,0,0.1);
  color: var(--orange);
}

/* ============================================
   點名動作條（全部到 + 計數 + ⋯ 更多）
   ============================================ */
.att-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.att-mark-all {
  flex: 1;
  padding: 12px 0;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.att-mark-all:active { opacity: 0.75; }
.att-count-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.att-more-wrap {
  position: relative;
}
.att-more-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--separator);
  background: var(--card);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.att-more-btn:active { background: var(--bg); }
.att-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--separator);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(60,40,20,.14);
  min-width: 210px;
  z-index: 20;
  overflow: hidden;
  padding: 4px 0;
}
.att-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.att-more-item:hover, .att-more-item:active { background: var(--bg); }
.att-more-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.att-more-sep {
  height: 1px;
  background: var(--separator);
  margin: 4px 0;
}

/* ============================================
   點名卡片模式（5人一排）
   ============================================ */
/* 2026-08-30：原本寫死 5 欄、手機每張只剩 41px 內容寬、三字名字必換行。
   改 auto-fill：390px 手機 4 欄（88px）、360px 3-4 欄、桌面自動更多欄。托育登記／才藝點名共用同一條。 */
.att-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.att-card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 6px;
  min-height: 56px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(60,40,20,.08);
  border: 2.5px solid var(--separator);
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.att-card:active { transform: scale(0.92); }

.att-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.att-card-status {
  font-size: 0.75rem;
  font-weight: 700;
  min-height: 1.1em;
}

.att-card.present {
  background: rgba(52,199,89,0.1);
  border-color: var(--green);
}
.att-card.present .att-card-status { color: var(--green); }

.att-card.absent {
  background: rgba(255,59,48,0.08);
  border-color: var(--red);
}
.att-card.absent .att-card-status { color: var(--red); }

/* ── 才藝點名卡專用（2026-08-13）：底色加濃、拉開辨別度 ──
   規則：到=綠、沒到=紅、任何假別也是紅（只是多一層斜紋＋虛線框，跟單純沒到分得開）
   只吃 .att-arts，不影響托育登記／班級點名／材料代辦那三個共用 .att-card-grid 的地方 */
.att-card-grid.att-arts .att-card {
  border-width: 3px;
  padding: 14px 6px;
}
.att-card-grid.att-arts .att-card.present {
  background: rgba(52,199,89,0.30);
  border-color: #3E8E57;
}
.att-card-grid.att-arts .att-card.present .att-card-status { color: #1F4F2E; }
.att-card-grid.att-arts .att-card.absent {
  background: rgba(217,43,32,0.20);
  border-color: #CF4130;
}
.att-card-grid.att-arts .att-card.absent .att-card-status { color: #CF4130; }

/* 請假：一樣紅，但斜紋＋虛線框，一眼跟「還沒點到的缺」分開 */
.att-card-grid.att-arts .att-card.leave {
  background: repeating-linear-gradient(135deg,
    rgba(217,43,32,0.28) 0 9px,
    rgba(217,43,32,0.08) 9px 18px);
  border-style: dashed;
  border-color: #CF4130;
}
.att-card-grid.att-arts .att-lv-tag {
  display: inline-block;
  background: #CF4130;
  color: #fff;
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.att-card-grid.att-arts .att-lv-hint {
  display: block;
  margin-top: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #CF4130;
  opacity: 0.85;
}
.att-card-grid.att-arts .att-lv-warn {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  color: #CF4130;
}

/* 這天還沒加入本班（2026-08-17）：灰底虛線、明顯比其他卡淡，一眼看出「這張不用處理」。
   刻意不用紅也不用綠——他既不是到也不是缺，是「不列入」。 */
.att-card-grid.att-arts .att-card.not-joined {
  background: rgba(142,142,147,0.10);
  border-color: #EDE7DD;
  border-style: dashed;
  opacity: 0.72;
}
.att-card-grid.att-arts .att-card.not-joined .att-card-name {
  color: var(--text-secondary);
}
.att-card-grid.att-arts .anm-tag {
  display: inline-block;
  background: #6F6A63;
  color: #fff;
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.att-card-grid.att-arts .anm-hint {
  display: block;
  margin-top: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* 按「全部到」被跳過的請假卡：閃三下，讓老師知道系統有反應、是故意不點的 */
@keyframes attSkipPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217,43,32,0); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(217,43,32,0.30); }
}
.att-card-grid.att-arts .att-card.just-skipped {
  animation: attSkipPulse 0.6s ease-in-out 3;
}

