/* ============================================
   出欠管理アプリ - スタイルシート
   ============================================ */

/* ============================================
   基本設定
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* ============================================
   カラー変数
   ============================================ */
:root {
  /* メインカラー（グラデーションブルー） */
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-darker: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-lighter: #eff6ff;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --primary-gradient-hover: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);

  /* アクセントカラー（パープル） */
  --accent-color: #8b5cf6;
  --accent-light: #ede9fe;

  /* 成功（緑） */
  --success-color: #10b981;
  --success-light: #d1fae5;
  --success-dark: #059669;

  /* 危険（赤） */
  --danger-color: #ef4444;
  --danger-light: #fee2e2;
  --danger-dark: #dc2626;

  /* 警告（オレンジ） */
  --warning-color: #f59e0b;
  --warning-light: #fef3c7;
  --warning-dark: #d97706;

  /* ニュートラル */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* レガシー互換 */
  --gray-light: var(--gray-50);
  --gray: var(--gray-500);
  --gray-dark: var(--gray-800);
  --border-color: var(--gray-200);

  /* シャドウ */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.03);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.15);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.03);
  --shadow-colored: 0 4px 14px 0 rgb(59 130 246 / 0.25);

  /* ボーダー半径 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* トランジション */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   ログイン画面
   ============================================ */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--primary-gradient);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.login-box {
  background: white;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 25px 50px -12px rgb(0 0 0 / 0.25);
  text-align: center;
  max-width: 420px;
  width: 90%;
  position: relative;
  z-index: 1;
}

.login-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-dark);
  margin-bottom: 8px;
}

.login-title .material-icons {
  color: var(--primary-color);
  font-size: 2rem;
}

.login-description {
  color: var(--gray);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-btn:hover {
  background: var(--gray-light);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn-line {
  background: #06C755;
  border-color: #06C755;
  color: white;
  margin-top: 12px;
}

.login-btn-line:hover {
  background: #05a847;
  border-color: #05a847;
  color: white;
}

.google-icon {
  width: 22px;
  height: 22px;
}

.login-error {
  color: var(--danger-color);
  margin-top: 16px;
  min-height: 20px;
  font-size: 0.9rem;
}

/* ============================================
   ヘッダー
   ============================================ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--primary-gradient);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title .material-icons {
  font-size: 1.5rem;
}

/* メールアドレスリスト */
.email-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-200);
}

.email-item:last-child {
  border-bottom: none;
}

.email-text {
  font-family: monospace;
  font-size: 0.9rem;
}

/* ヘッダーアクション（ボタン群） */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ヘッダー内ボタン共通 */
.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.header-btn:active {
  transform: scale(0.95);
}

.header-btn .material-icons {
  font-size: 20px;
}

/* ヘッダー内更新ボタン */
.header-btn.refresh-btn {
  background: rgba(255, 255, 255, 0.2);
}

.header-btn.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.header-btn.refresh-btn.loading {
  cursor: not-allowed;
  opacity: 0.7;
}

.header-btn.refresh-btn.loading .material-icons {
  animation: spin 1s linear infinite;
}

.header-btn.refresh-btn.flash {
  animation: header-flash 0.6s ease;
}

@keyframes header-flash {
  0% {
    background: rgba(255, 255, 255, 0.2);
  }

  50% {
    background: rgba(34, 197, 94, 0.8);
  }

  100% {
    background: rgba(255, 255, 255, 0.2);
  }
}

/* ============================================
   アカウントメニュー
   ============================================ */
.account-menu-wrapper {
  position: relative;
}

.btn-account {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-full);
  transition: background 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 150px;
}

.btn-account:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-account .material-icons {
  font-size: 22px;
  flex-shrink: 0;
}

.account-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 220px;
  z-index: 200;
  overflow: hidden;
  animation: dropdown-in 0.15s ease;
}

.account-dropdown.open {
  display: block;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.account-dropdown-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--gray-50);
}

.account-dropdown-icon {
  font-size: 36px;
  color: var(--primary-color);
  flex-shrink: 0;
}

.account-dropdown-details {
  overflow: hidden;
}

.account-dropdown-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown-email {
  font-size: 0.78rem;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 0;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
  transition: background 0.15s;
  text-align: left;
}

.account-dropdown-item:hover {
  background: var(--gray-100);
}

.account-dropdown-item .material-icons {
  font-size: 18px;
  color: var(--gray-500);
}

/* ============================================
   教室セレクター
   ============================================ */
.classroom-selector {
  background: linear-gradient(135deg, #1e40af 0%, #6d28d9 100%);
  padding: 8px 20px;
  position: sticky;
  top: 56px;
  z-index: 99;
}

.classroom-selector select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.classroom-selector select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.25);
}

.classroom-selector select option {
  background: #1e40af;
  color: white;
}

/* ============================================
   メインコンテンツ
   ============================================ */
.main-content {
  padding: 20px;
  padding-bottom: 80px;
  /* 下部ナビの高さ分 */
  max-width: 800px;
  margin: 0 auto;
}

/* タブセクション */
.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

/* サブタブ（セグメントコントロール） */
.sub-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-xl);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.sub-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.sub-tab-btn .material-icons {
  font-size: 20px;
}

.sub-tab-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-colored);
}

.sub-tab-btn.active .material-icons {
  color: white;
}

.sub-tab-btn:not(.active):hover {
  color: var(--primary-color);
  background: var(--primary-lighter);
}

.sub-tab-panel {
  display: none;
}

.sub-tab-panel.active {
  display: block;
}

/* セクションヘッダー */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   下部ナビゲーション
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: white;
  border-top: 1px solid var(--gray-100);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -8px 24px -4px rgb(0 0 0 / 0.08);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  border-radius: var(--radius-md);
  position: relative;
}

.nav-btn .material-icons {
  font-size: 24px;
  transition: all var(--transition-bounce);
}

.nav-btn.active {
  color: var(--primary-color);
}

.nav-btn.active .material-icons {
  transform: scale(1.15) translateY(-2px);
}

/* アクティブインジケーター */
.nav-btn.active::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}

.nav-btn:hover {
  color: var(--primary-color);
}

.nav-btn:active .material-icons {
  transform: scale(0.95);
}

/* ============================================
   ボタン共通スタイル
   ============================================ */
.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.add-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-colored);
}

.add-btn:hover::before {
  opacity: 1;
}

.add-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.add-btn .material-icons {
  font-size: 18px;
}

.add-btn.small {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

.add-btn.secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: none;
}

.add-btn.secondary:hover {
  background: var(--primary-lighter);
  box-shadow: var(--shadow-sm);
}

.save-btn {
  padding: 10px 18px;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.save-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* ============================================
   ソートバー・フィルターバー
   ============================================ */
/* ツールバー（ソート＋フィルター統合） */
.toolbar {
  margin-bottom: 10px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}

.toolbar-select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  background: var(--gray-50);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.toolbar-select:focus {
  border-color: var(--primary-color);
  background: white;
}

.toolbar-filter-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.toolbar-filter-btn .material-icons {
  font-size: 16px;
}

.toolbar-filter-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: var(--primary-lighter);
}

.toolbar.open .toolbar-filter-btn {
  color: white;
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.toolbar-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--primary-lighter);
  border-radius: var(--radius-full);
  min-width: fit-content;
}

.toolbar-filter-panel {
  display: none;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.toolbar.open .toolbar-filter-panel {
  display: block;
}

.filter-group {
  margin-bottom: 6px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.filter-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-600);
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-checkboxes label:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-checkboxes label input {
  display: none;
}

.filter-checkboxes label.checked {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-dark);
  font-weight: 600;
}

/* 一括削除ボタン */
.delete-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-all-btn:hover {
  background: var(--danger-light);
  transform: translateY(-1px);
}

.delete-all-btn .material-icons {
  font-size: 20px;
}

/* ============================================
   並び替えコントロール
   ============================================ */
.list-item-order {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-right: 12px;
  flex-shrink: 0;
}

.order-btn {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 20px;
  transition: all 0.2s;
  margin: 1px 0;
}

.order-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.order-btn .material-icons {
  font-size: 18px;
}

.order-spacer {
  width: 28px;
  height: 20px;
  margin: 1px 0;
}

/* ============================================
   リスト表示
   ============================================ */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

/* 左側のアクセントバー */
.list-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.list-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.list-item:hover::before {
  opacity: 1;
}

/* クリック可能なリストアイテム */
.list-item.clickable {
  cursor: pointer;
}

.list-item.clickable:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* リストアイテム右側の矢印 */
.list-item-arrow {
  display: flex;
  align-items: center;
  color: var(--gray-400);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.list-item.clickable:hover .list-item-arrow {
  color: var(--primary-color);
  transform: translateX(3px);
}

/* クラスバッジ行 */
.list-item-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.class-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #c7d2fe 100%);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.sub-class-badge {
  flex-wrap: wrap;
  column-gap: 6px;
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
}

.sub-class-badge > span {
  white-space: nowrap;
}

.sub-class-parent {
  font-weight: 400;
  color: var(--gray-500);
}

/* ============================================
   詳細モーダル
   ============================================ */
.detail-modal-body {
  padding: 24px;
}

.detail-field {
  display: flex;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

.detail-field:last-child {
  border-bottom: none;
}

.detail-label {
  flex-shrink: 0;
  width: 90px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray);
  padding-top: 2px;
}

.detail-value {
  flex: 1;
  font-size: 0.95rem;
  color: var(--gray-800);
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.detail-value-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
}

.detail-value-memo {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.detail-modal-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px 24px;
  justify-content: center;
}

.detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.detail-btn .material-icons {
  font-size: 20px;
}

.detail-btn-edit {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  flex: 1;
}

.detail-btn-edit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.detail-btn-delete {
  background: white;
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
  flex: 1;
}

.detail-btn-delete:hover {
  background: var(--danger-light);
  transform: translateY(-1px);
}

.list-item-info {
  flex: 1;
  min-width: 0;
  padding-left: 4px;
}

.list-item-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.list-item-furigana {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray-400);
}

.list-item-sub {
  font-size: 0.82rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 教室セクション見出し（複数教室ビュー時） */
.classroom-section-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 6px 12px;
  margin-top: 8px;
  border-left: 3px solid #1a73e8;
}
.classroom-section-header:first-child {
  margin-top: 0;
}
.subclass-section-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: #5f6368;
  background: #f1f3f4;
  padding: 4px 12px;
  margin-top: 4px;
  border-left: 3px solid #9aa0a6;
}
.classroom-section-header + .subclass-section-header {
  margin-top: 0;
}

/* 集計テーブル内の教室セクション行 */
.classroom-section-row td {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 4px 8px;
  border-left: 3px solid #1a73e8;
  text-align: left;
}

/* 短縮教室名バッジ（クラス/サブクラス順以外のソート時） */
.list-item-classroom {
  font-size: 0.72rem;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-sub-line .list-item-classroom {
  font-size: 0.65rem;
  padding: 0 4px;
}

.list-item-subclass {
  margin-left: 2px;
  color: var(--primary-color, #4f46e5);
  font-size: 0.8rem;
  font-weight: 500;
}

.list-item-role {
  font-size: 0.72rem;
  color: var(--primary-dark);
  background: rgba(59, 130, 246, 0.1);
  padding: 1px 8px;
  border-radius: 9999px;
  font-weight: 600;
}

.list-item-grade {
  margin-left: 2px;
  color: var(--gray-500);
  font-size: 0.8rem;
}

/* 勤怠打刻済みバッジ */
.kintai-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success-dark);
  background: var(--success-light);
  padding: 1px 8px 1px 5px;
  border-radius: 9999px;
}

.kintai-badge .material-icons {
  font-size: 13px;
}

/* ヘッダーアクションボタン */
.btn-header-action {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-600);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-header-action .material-icons {
  font-size: 1.1rem;
}

.btn-header-action:hover {
  background: var(--gray-50);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-header-action.sort-active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ドラッグハンドル（通常時は非表示） */
.drag-handle {
  display: none;
  align-items: center;
  padding-right: 8px;
  color: var(--gray-400);
  cursor: grab;
  touch-action: none;
}

.drag-handle .material-icons {
  font-size: 1.2rem;
}

/* 並び替えモード */
.sort-mode .drag-handle {
  display: flex;
}

.sort-mode .list-item {
  cursor: grab;
  user-select: none;
}

.sort-mode .list-item.drag-placeholder {
  transition: none;
}

.sort-mode .list-item-arrow {
  display: none;
}

.sort-mode .list-item:active {
  cursor: grabbing;
}

/* ドラッグ中のプレースホルダー（元の位置） */
.drag-placeholder {
  opacity: 0.3;
  border: 2px dashed var(--primary-color, #3b82f6);
  background: var(--primary-lighter, #eff6ff);
}

/* ドラッグ中のフローティングクローン */
.drag-clone {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18),
              0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: #fff;
  opacity: 0.95;
  transform: scale(1.03) rotate(1deg);
}

/* 会員番号バッジ */
.member-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  background: var(--primary-gradient);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 40px;
  letter-spacing: 0.02em;
}

/* キャンペーンバッジ */
.campaign-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid #f59e0b;
  margin-left: 4px;
}

.list-item-badge {
  display: inline-flex;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.list-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0.6;
  transition: opacity var(--transition-normal);
}

.list-item:hover .list-item-actions {
  opacity: 1;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-full);
  color: var(--gray-400);
  transition: all var(--transition-normal);
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--primary-color);
  transform: scale(1.1);
}

.btn-icon.danger:hover {
  background: var(--danger-light);
  color: var(--danger-color);
}

.btn-icon .material-icons {
  font-size: 20px;
  display: block;
}

/* 空の状態 */
.empty-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-message::before {
  content: 'inbox';
  font-family: 'Material Icons';
  font-size: 48px;
  color: var(--gray-300);
}

.placeholder-text {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--gray-200);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.placeholder-text::before {
  content: 'touch_app';
  font-family: 'Material Icons';
  font-size: 36px;
  color: var(--gray-300);
}

/* ============================================
   モーダル
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 25px 50px -12px rgb(0 0 0 / 0.25);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-small {
  max-width: 380px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--gray-light);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-dark);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--border-color);
  color: var(--gray-dark);
}

/* ============================================
   フォーム
   ============================================ */
.modal-form {
  padding: 24px;
}

/* 横並びフォームグループ */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.form-row .form-group {
  margin-bottom: 0;
}

.form-group-half {
  flex: 1;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-normal);
  background: white;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--gray-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-lighter);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  background: var(--primary-light);
}

.checkbox-item input {
  width: auto;
  accent-color: var(--primary-color);
}

.checkbox-item input:checked+span {
  color: var(--primary-color);
  font-weight: 500;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.btn-cancel {
  padding: 12px 24px;
  background: white;
  color: var(--gray-dark);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: var(--gray-light);
  border-color: #cbd5e1;
}

.btn-save {
  padding: 12px 24px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-save:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  padding: 12px 24px;
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ============================================
   出欠管理
   ============================================ */

/* 開催日タイトルバー */
.attendance-event-title-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fff4e8 0%, #fff8f2 100%);
  border: 1px solid #f5c07a;
  border-radius: 10px;
  margin-bottom: 12px;
}

.aetb-icon {
  color: #E8740C;
  font-size: 22px !important;
  flex-shrink: 0;
}

.aetb-title {
  font-size: 1rem;
  font-weight: 700;
  color: #b35500;
  line-height: 1.3;
}

.aetb-date {
  font-size: 0.78rem;
  color: #888;
  margin-top: 1px;
}

/* event-selector の下マージンを小さめに（タイトルバーと繋がる） */
.attendance-event-title-bar + .toolbar {
  margin-top: 0;
}

.event-selector {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.event-selector label {
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

.event-selector select {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 500;
  background: white;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.event-selector select:hover {
  border-color: var(--gray-300);
}

.event-selector select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-lighter);
}

.attendance-area {
  background: white;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
}

.attendance-group {
  margin-bottom: 24px;
}

.attendance-group:last-child {
  margin-bottom: 0;
}

.attendance-group-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--accent-light) 100%);
  border-left: 4px solid;
  border-image: var(--primary-gradient) 1;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Inner tabs (attendance/summary sub-tabs) */
.inner-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--gray-100);
  border-radius: 9999px;
  margin-bottom: 16px;
}

.inner-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-500);
  text-align: center;
}

.inner-tab.active {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  color: var(--primary-color);
}

.inner-tab:not(.active):hover {
  color: var(--gray-700);
}

.inner-tab-badge {
  font-size: 0.75rem;
  font-weight: 400;
  margin-left: 4px;
  color: inherit;
  opacity: 0.7;
}

.inner-tab-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left: 6px;
  background: var(--danger-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9999px;
  line-height: 1;
  vertical-align: middle;
}

.attendance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  transition: all var(--transition-normal);
}

.attendance-item:hover {
  background: var(--gray-50);
}

.attendance-item:last-child {
  border-bottom: none;
}

/* 未入力の行を目立たせるインジケーター */
.attendance-item.attendance-unchecked {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(90deg, #fffbeb 0%, white 40%);
}
.attendance-item.attendance-unchecked:hover {
  background: linear-gradient(90deg, #fef3c7 0%, var(--gray-50) 40%);
}

.attendance-name-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.attendance-name {
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.attendance-sub {
  font-size: 0.82rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.attendance-buttons {
  display: flex;
  gap: 8px;
}

.attendance-btn {
  padding: 8px 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-bounce);
}

.attendance-btn.present {
  border-color: var(--success-color);
  color: var(--success-color);
}

.attendance-btn.present:hover {
  background: var(--success-light);
  transform: scale(1.05);
}

.attendance-btn.present.active {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
  border-color: var(--success-color);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: scale(1.05);
}

.attendance-btn.absent {
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.attendance-btn.absent:hover {
  background: var(--danger-light);
  transform: scale(1.05);
}

.attendance-btn.absent.active {
  background: var(--danger-color);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}
.attendance-btn.note-btn {
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
}
.attendance-btn.note-btn.has-note {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
}
.attendance-btn.unassign-btn {
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
}
.attendance-btn.unassign-btn:hover {
  color: var(--danger-color);
  border-color: var(--danger-color);
}
.attendance-note-preview {
  font-size: 0.78rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}

/* 開催日選択 */
.event-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
}

.event-selector label {
  white-space: nowrap;
  font-weight: 600;
  color: var(--gray-dark);
}

.event-selector select {
  flex: 1;
  min-width: 0;
  /* これ重要 */
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background-color: white;
  transition: all 0.2s ease;
  cursor: pointer;
}

.event-selector select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 出欠サマリー */
.attendance-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  align-items: center;
  justify-content: flex-start;
}

.summary-item {
  text-align: center;
  flex: 1;
  padding: 6px 8px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.summary-label {
  font-size: 0.72rem;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 0;
  letter-spacing: 0.02em;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 800;
}

.summary-value.present {
  color: var(--success-color);
}

.summary-value.absent {
  color: var(--danger-color);
}

/* ============================================
   出欠集計 - シンプル版
   ============================================ */

/* 期間選択 */
.period-selector {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.period-selector label {
  font-weight: 600;
  color: var(--gray-dark);
  white-space: nowrap;
}

.period-selector select {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 300px;
}

.period-selector select:hover {
  border-color: #cbd5e1;
}

.period-selector select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 更新ボタン */
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--gray-dark);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.refresh-btn:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: var(--primary-color);
  color: var(--primary-dark);
}

.refresh-btn:active {
  transform: scale(0.98);
}

.refresh-btn .material-icons {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

/* ローディング状態 */
.refresh-btn.loading {
  background: #f1f5f9;
  color: var(--gray);
  cursor: not-allowed;
}

.refresh-btn.loading .material-icons {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* フラッシュエフェクト */
.refresh-btn.flash {
  animation: flash-effect 0.6s ease;
}

@keyframes flash-effect {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    background: #dcfce7;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.summary-area {
  background: transparent;
  padding: 0;
}

/* 上部のサマリーバー */
.summary-header-bar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid #bae6fd;
}

.summary-header-bar .summary-info {
  font-size: 0.95rem;
  color: var(--gray-dark);
}

.summary-header-bar .summary-info strong {
  color: var(--primary-dark);
  font-size: 1.1rem;
}

/* 開催日詳細セクション（集計画面） */
.event-details-section {
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--amber-50, #fffbeb);
  border-left: 3px solid var(--amber-400, #fbbf24);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--gray-700);
}

.event-detail-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
  flex-wrap: wrap;
}

.event-detail-date {
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
}

.event-detail-title {
  font-weight: 600;
}

.event-detail-note {
  color: var(--gray-500);
}

/* 集計ヘッダーのイベントタイトル */
.date-col-title {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
  margin-bottom: 2px;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.date-col-venue {
  font-size: 0.6rem;
  font-weight: 500;
  color: #0e7490;
  line-height: 1.25;
  margin-top: 2px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.spot-count-hint {
  font-size: 0.65rem;
  color: #6b7280;
  margin-top: 2px;
  font-weight: 500;
}

/* セクションカード */
.section-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-card .section-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-color);
}

.section-card .section-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-dark);
}

/* テーブルラッパー（横スクロール対応） */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 年間ビュー用の強調スクロール */
.table-wrapper.yearly-view {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 400px;
  overflow-y: auto;
}

.table-wrapper.yearly-view::after {
  content: '← 横スクロールで全日程を表示 →';
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 0.75rem;
  color: var(--gray);
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

/* 出欠テーブル */
.attendance-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: white;
}

.attendance-table th,
.attendance-table td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attendance-table thead th {
  background: #f8fafc;
  color: var(--gray-dark);
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* 名前列（固定） */
.attendance-table .sticky-name {
  position: sticky;
  left: 0;
  z-index: 5;
  background: white;
  text-align: left;
  font-weight: 500;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  border-right: 1px solid var(--border-color);
}

.attendance-table thead .sticky-name {
  background: #f8fafc;
  z-index: 15;
}

/* 名前セル内の追加情報 */
.person-name-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.person-name-main {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.person-sub-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.person-sub-line .class-badge {
  font-size: 0.6rem;
  padding: 0px 4px;
  line-height: 1.4;
}

.person-sub-line .list-item-subclass {
  font-size: 0.7rem;
  color: var(--primary-color, #4f46e5);
  font-weight: 500;
}

.person-sub-line .list-item-grade {
  font-size: 0.7rem;
}

/* 日付列 */
.attendance-table .date-col {
  width: 48px;
  min-width: 48px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 4px;
}
/* 会場ありの日付列は少し広げて折り返し表示 */
.attendance-table .date-col:has(.date-col-venue) {
  min-width: 84px;
  width: 84px;
}

/* 出席回数列（計） - 最小固定 */
.attendance-table .col-count {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-dark);
  background: #fafafa;
  border-left: 1px solid var(--border-color);
  padding: 10px 4px;
}

.attendance-table thead .col-count {
  background: #f1f5f9;
  font-size: 0.75rem;
}

/* データ行 */
.attendance-table .data-row:hover {
  background: #f8fafc;
}

.attendance-table .data-row:hover .sticky-name {
  background: #f1f5f9;
}

/* ステータスセル */
.attendance-table .status {
  font-size: 1.1rem;
  font-weight: 600;
}

.attendance-table .status.present {
  color: #22c55e;
}

.attendance-table .status.absent {
  color: #ef4444;
}

.attendance-table .status.unknown {
  color: #cbd5e1;
}

.attendance-table .status.not-enrolled {
  background-color: #f1f5f9;
}

/* 合計行 */
.attendance-table .total-row {
  background: #f8fafc;
  border-top: 2px solid var(--border-color);
}

.attendance-table .total-row td {
  font-weight: 600;
  color: var(--gray-dark);
  font-size: 0.85rem;
}

.attendance-table .total-row .sticky-name {
  background: #f1f5f9;
}

.attendance-table .total-row .total-label {
  font-size: 0.8rem;
  color: var(--gray);
}

.attendance-table .total-row .total-count {
  color: var(--gray-dark);
}

.attendance-table .total-count .fraction {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}

.attendance-table .total-count .numerator {
  color: var(--success-color);
  font-weight: 700;
  font-size: 0.95rem;
}

.attendance-table .total-count .separator {
  color: var(--gray-400);
  font-size: 0.75rem;
  margin: 0 1px;
}

.attendance-table .total-count .denominator {
  color: var(--gray-500);
  font-size: 0.75rem;
  font-weight: 500;
}

/* 凡例バー */
.legend-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 16px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.legend-bar .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gray);
}

.legend-bar .symbol {
  font-weight: 700;
  font-size: 1rem;
}

.legend-bar .symbol.present {
  color: #22c55e;
}

.legend-bar .symbol.absent {
  color: #ef4444;
}

.legend-bar .symbol.unknown {
  color: #cbd5e1;
}

/* ヘッダーのボタングループ */
.header-buttons {
  display: flex;
  gap: 10px;
}

.header-buttons .add-btn {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* 出力ドロップダウン */
.export-dropdown {
  position: relative;
}

.export-dropdown .add-btn .export-arrow {
  font-size: 18px;
  margin-left: -2px;
  transition: transform 0.2s;
}

.export-dropdown.open .add-btn .export-arrow {
  transform: rotate(180deg);
}

.export-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}

.export-dropdown.open .export-menu {
  display: block;
  animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.export-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: background 0.15s;
}

.export-menu-item:hover {
  background: var(--gray-50);
  color: var(--primary-color);
}

.export-menu-item:not(:last-child) {
  border-bottom: 1px solid var(--gray-100);
}

.export-menu-item .material-icons {
  font-size: 20px;
  color: var(--gray-400);
}

.export-menu-item:hover .material-icons {
  color: var(--primary-color);
}

/* ============================================
   設定
   ============================================ */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setting-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: white;
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.setting-item label {
  font-weight: 600;
  white-space: nowrap;
  color: var(--gray-dark);
}

.setting-item input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.setting-item input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.setting-group {
  background: white;
  padding: 24px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.setting-group h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--gray-800);
  padding-bottom: 14px;
  border-bottom: 2px solid;
  border-image: var(--primary-gradient) 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-add-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.setting-add-row input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.setting-add-row input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.classes-list,
.venues-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.class-item,
.venue-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  gap: 10px;
}

.class-item:hover,
.venue-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
}

.class-item .class-item-name {
  flex: 1;
  font-weight: 600;
  color: var(--gray-dark);
}

.venue-item span {
  font-weight: 500;
  color: var(--gray-dark);
}

.venue-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
  background: white;
}
.venue-check-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.35;
}
.venue-check-grid input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin: 0;
}
.venue-check-grid .pin-marker {
  font-size: 0.8rem;
  color: #6366f1;
  margin-right: 2px;
}

.class-order-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-icon-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 20px;
  padding: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.15s ease;
}

.btn-icon-sm .material-icons {
  font-size: 14px;
}

.btn-icon-sm:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-icon-sm:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.class-order-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  background: var(--primary-gradient);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  line-height: 1;
}

/* ============================================
   レスポンシブ対応
   ============================================ */
@media (max-width: 600px) {
  .header {
    padding: 10px 14px;
  }

  .header-title {
    font-size: 1rem;
  }

  .classroom-selector {
    padding: 6px 14px;
    top: 44px;
  }

  .classroom-selector select {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .main-content {
    padding: 12px;
    padding-bottom: 90px;
  }

  .section-header h2 {
    font-size: 1.1rem;
  }

  .nav-btn {
    font-size: 0.6rem;
    padding: 4px 2px;
  }

  .nav-btn .material-icons {
    font-size: 20px;
    margin-bottom: 2px;
  }

  /* 開催日選択（スマホレイアウト調整: 縦並びにして表示領域確保） */
  .event-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px 14px;
  }

  .event-selector select {
    width: 100%;
    min-width: 0;
  }

  /* リストアイテムをPCライクに横並び維持 */
  .list-item {
    padding: 12px;
    gap: 10px;
    /* columnにしない */
  }

  /* 名前と右側の情報を離す */
  .list-item-info {
    flex: 1;
    min-width: 0;
    /* テキスト省略用 */
  }

  .list-item-name {
    font-size: 0.95rem;
  }

  .list-item-sub {
    margin-top: 4px;
    flex-wrap: wrap;
    /* バッジが多い場合は折り返し */
  }

  /* アクションボタンは右端に維持 */
  /* align-self: flex-end; を削除したのでPCと同じ配置になる */

  /* 設定項目もできるだけ横並び */
  .setting-item {
    padding: 14px;
    gap: 10px;
    flex-direction: column;
    /* 入力欄はやはり縦の方が使いやすいが、ラベルとの関係を調整 */
    align-items: stretch;
  }

  /* でも設定グループ内の追加行などは横並び維持したい場合 */
  .setting-add-row {
    margin-bottom: 12px;
  }

  /* 出欠アイテムも横並び維持 */
  .attendance-item {
    padding: 10px 12px;
    gap: 10px;
    /* columnにしない */
  }

  .attendance-info {
    flex: 1;
    min-width: 0;
  }

  /* ボタンはアイコンのみにするなどして省スペース化 */
  .attendance-buttons {
    gap: 4px;
  }

  .attendance-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .attendance-btn span:not(.material-icons) {
    display: none;
    /* テキストを隠してアイコンのみに */
  }

  .attendance-btn .material-icons {
    margin: 0;
    font-size: 20px;
  }

  /* ヘッダーボタンも横並び維持 */
  .header-buttons {
    /* columnにしない */
    gap: 8px;
  }

  .header-buttons .add-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  /* モーダルは全画面近くに */
  .modal-content {
    margin: 10px;
    width: calc(100% - 20px);
    max-height: 90vh;
  }

  .modal-form {
    padding: 16px;
  }

  .form-actions {
    /* ボタンは横並びのままの方がPCに近いが、押しやすさ優先で維持するか、横並びにするか */
    /* PCに近づけるなら横並び */
    flex-direction: row;
    gap: 10px;
  }

  .form-actions button {
    flex: 1;
  }

  .login-box {
    padding: 24px 20px;
    width: 90%;
  }
}

/* ============================================
   追加のユーティリティスタイル
   ============================================ */

/* スクロールバーのスタイル */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* フォーカスリングのスタイル */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 選択時のスタイル */
::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* テキストのトランジション */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   一括インポート機能
   ============================================ */
.import-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-section h3 .material-icons {
  color: var(--primary-color);
}

.setting-description {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.import-template-section {
  background: var(--primary-light);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.import-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-dark);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.import-hint .material-icons {
  font-size: 18px;
}

/* 列情報テーブル */
.import-columns-info {
  margin-bottom: 24px;
}

.import-columns-info h4 {
  font-size: 0.95rem;
  color: var(--gray-dark);
  margin-bottom: 12px;
}

.columns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.columns-table th,
.columns-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.columns-table th {
  background: var(--gray-light);
  font-weight: 600;
  color: var(--gray-dark);
}

.columns-table tr:last-child td {
  border-bottom: none;
}

.required-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--danger-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

/* ファイルアップロードエリア */
.import-upload-section {
  margin-bottom: 24px;
}

.import-upload-section h4 {
  font-size: 0.95rem;
  color: var(--gray-dark);
  margin-bottom: 12px;
}

.file-upload-area {
  position: relative;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gray-light);
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-label:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  color: var(--primary-color);
}

.file-label .material-icons {
  font-size: 36px;
}

/* プレビューエリア */
.import-preview-section {
  margin-bottom: 24px;
}

.import-preview-section h4 {
  font-size: 0.95rem;
  color: var(--gray-dark);
  margin-bottom: 12px;
}

.import-preview {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 400px;
  overflow: auto;
}

.import-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--success-light);
  color: #059669;
  border-radius: var(--radius-sm);
  font-weight: 500;
  margin-bottom: 12px;
}

.import-info .material-icons {
  font-size: 20px;
}

/* プレビューテーブル */
.import-preview .table-wrapper {
  overflow-x: auto;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 600px;
}

.import-preview-table th,
.import-preview-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.import-preview-table th {
  background: var(--gray-light);
  font-weight: 600;
  color: var(--gray-dark);
  position: sticky;
  top: 0;
}

.import-preview-table tr:hover {
  background: var(--gray-light);
}

.import-preview-table tr:last-child td {
  border-bottom: none;
}

/* プレビューアクションボタン */
.import-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.import-preview-actions .btn-cancel,
.import-preview-actions .btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.import-preview-actions .btn-cancel .material-icons,
.import-preview-actions .btn-save .material-icons {
  font-size: 18px;
}

/* インポート済みデータセクション */
.imported-data-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px dashed var(--border-color);
}

.imported-data-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--gray-dark);
  margin-bottom: 16px;
}

.imported-data-section h4 .material-icons {
  color: var(--primary-color);
  font-size: 20px;
}

.import-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--gray-light);
  border-radius: var(--radius-md);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--warning-color);
  font-weight: 500;
}

.stat-item .material-icons {
  font-size: 18px;
}

.stat-item.merged {
  color: var(--success-color);
}

.imported-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.imported-members-list .list-item {
  padding: 12px 16px;
}

.imported-members-list .list-item.status-merged {
  opacity: 0.7;
  background: var(--success-light);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-badge.status-pending {
  background: linear-gradient(135deg, var(--warning-color) 0%, #f97316 100%);
  color: white;
}

.status-badge.status-merged {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
}

.stat-item.pending {
  color: var(--warning-color);
}

/* 一括反映アクション */
.import-merge-actions {
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-radius: var(--radius-lg);
  border: 1px solid #a7f3d0;
  text-align: center;
}

.merge-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.02em;
}

.merge-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.merge-all-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.merge-all-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.merge-all-btn .material-icons {
  font-size: 22px;
}

.merge-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: #059669;
}

.merge-hint .material-icons {
  font-size: 16px;
}

/* 個別反映ボタンのスタイル */
.btn-icon.merge-single-btn {
  color: #10b981;
}

.btn-icon.merge-single-btn:hover {
  background: #ecfdf5;
  color: #059669;
  transform: scale(1.15);
}

/* ローディングアニメーション */
@keyframes rotating {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.rotating {
  animation: rotating 1s linear infinite;
}

/* ============================================
   トースト通知
   ============================================ */
/* 左右に余白を取った帯の中央に置く。left:50% だけで幅を決めていた頃は
   スマホで画面の半分に縮み、1行1〜2文字で縦に伸びていた */
.toast-container {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  padding: 10px 12px 10px 14px;
  background: #1f2937;
  color: white;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
  font-weight: 500;
  font-size: 0.9rem;
  pointer-events: auto;
  animation: toastSlideIn 0.2s ease-out;
}

.toast > .material-icons {
  font-size: 20px;
  flex-shrink: 0;
}

.toast.success > .material-icons { color: #34d399; }
.toast.info > .material-icons { color: #93c5fd; }
.toast.warning > .material-icons { color: #fbbf24; }
.toast.error { background: #b91c1c; }

.toast.hiding {
  animation: toastSlideOut 0.18s ease-in forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes toastSlideOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.hiding { animation-duration: 0.01ms; }
}
/* ============================================
   �ۑ����C���W�P�[�^�[
   ============================================ */
.saving-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  margin-right: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.saving-indicator.visible {
  opacity: 1;
}

.spin {
  animation: spin 1s linear infinite;
  font-size: 24px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   �o���T�}���[�̃��x��
   ============================================ */
.event-note {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--amber-50, #fffbeb);
  border-left: 3px solid var(--amber-400, #fbbf24);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--gray-700);
  white-space: pre-wrap;
}

.event-note .material-icons {
  font-size: 1.1rem;
  color: var(--amber-500, #f59e0b);
  flex-shrink: 0;
  margin-top: 1px;
}

.attendance-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  white-space: nowrap;
  padding-right: 10px;
  margin-right: 2px;
  border-right: 1px solid var(--gray-200);
  flex-shrink: 0;
}

/* ============================================
   iPad���ł̓��t���̓t�B�[���h�̂͂ݏo���C��
   ============================================ */
input[type='date'],
input[type='datetime-local'],
input[type='month'],
input[type='time'] {
  max-width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none; /* iOS�̃f�t�H���g�X�^�C�������Z�b�g */
  appearance: none;
  min-width: 0; /* Flexbox���ł̈��h�~ */
}

/* ���[�_�����̃t�H�[���O���[�v�̒��� */
.modal-form .form-group {
  max-width: 100%;
  position: relative; /* �R���e�i�Ƃ��Ă̊�_ */
}

/* ���[�_���̃��X�|���V�u���� */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10px auto;
    padding: 20px 16px; /* �p�f�B���O���������炷 */
  }
}

/* ============================================
   会員一括選択・削除
   ============================================ */
.add-btn.secondary {
  background: #ffffff;
  color: var(--gray-dark);
  border: 1.5px solid var(--border-color);
}
.add-btn.secondary:hover {
  background: var(--gray-100);
}

.list-item-check {
  display: flex;
  align-items: center;
  padding: 0 10px 0 4px;
  flex-shrink: 0;
}
.member-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.list-item.selected {
  background: var(--primary-lighter);
  border-color: var(--primary-color);
}

.bulk-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gray-dark);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  z-index: 200;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
}

.bulk-count {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
}

.bulk-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #475569;
  color: #ffffff;
}
.bulk-btn:hover {
  opacity: 0.85;
}
.bulk-btn.danger {
  background: var(--danger-color);
}
.bulk-btn.cancel {
  background: #64748b;
}

/* ============================================
   インポートプレビュー編集
   ============================================ */
.editable-cell {
  cursor: text;
  min-width: 50px;
  white-space: nowrap;
  outline: none;
}
.editable-cell:focus {
  outline: 2px solid var(--primary-color);
  background: var(--primary-lighter);
  border-radius: 3px;
}

.preview-no {
  text-align: center;
  color: var(--gray);
  font-size: 0.8rem;
  user-select: none;
}

.preview-delete-cell {
  text-align: center;
  padding: 0 4px !important;
}
.preview-row-delete-btn {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}
.preview-row-delete-btn:hover {
  background: var(--danger-light);
}

/* ============================================
   初期ローディング
   ============================================ */
body.app-loading .main-content {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}

body.app-loading .main-content::before {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

body.app-loading .tab-section,
body.app-loading .bottom-nav {
  display: none;
}

/* ============================================
   スポット参加機能
   ============================================ */

/* スポットバッジ */
.spot-badge {
  display: inline-block;
  padding: 1px 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* スポットセクション見出し */
.spot-section-header {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border-left: 3px solid #f59e0b !important;
  color: #92400e !important;
}

/* スポット参加追加ボタン */
.spot-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: white;
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-lg);
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spot-add-btn:hover {
  border-color: #f59e0b;
  color: #d97706;
  background: #fffbeb;
}

.spot-add-btn .material-icons {
  font-size: 20px;
}

/* スポット追加フォーム */
.spot-add-form {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}

.spot-form-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-800);
  margin-bottom: 12px;
}

.spot-form-field {
  margin-bottom: 8px;
}

.spot-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.spot-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.spot-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.spot-form-cancel {
  padding: 8px 16px;
  background: var(--gray-100);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--gray);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spot-form-cancel:hover {
  background: var(--gray-200);
}

.spot-form-submit {
  padding: 8px 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.spot-form-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* スポット削除ボタン */
.spot-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.2s ease;
}

.spot-delete-btn:hover {
  background: var(--danger-light);
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.spot-delete-btn .material-icons {
  font-size: 18px;
}

/* 集計テーブルのスポット行 */
.attendance-table .spot-row .sticky-name {
  background: #fffbeb;
}

.attendance-table .spot-row:hover .sticky-name {
  background: #fef3c7;
}

.attendance-table .spot-row td {
  font-size: 0.85rem;
}

/* ============================================
   臨時スタッフ
   ============================================ */

/* 臨時バッジ（ティール） */
.spot-coach-badge {
  display: inline-block;
  padding: 1px 8px;
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* 臨時スタッフの見出し */
.spot-coach-section-header {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%) !important;
  border-left: 3px solid #0891b2 !important;
  color: #164e63 !important;
}

/* 臨時スタッフを追加ボタン（ティール） */
.spot-coach-add-btn:hover {
  border-color: #0891b2;
  color: #0e7490;
  background: #ecfeff;
}

/* 行の「外す」ボタン（特記事項ボタンと同じ大きさ） */
.attendance-btn.temp-remove-btn {
  width: 40px; height: 44px; min-width: 40px; padding: 0; border-radius: 999px;
  border: 1px solid var(--gray-200); background: transparent; color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
}
.attendance-btn.temp-remove-btn:hover { color: var(--danger-color); border-color: var(--danger-color); }

/* 追加シート（temp-staff.js）: 検索と一覧と下のボタン。一覧だけがスクロールする */
.sheet.tsp-sheet { height: min(80vh, 680px); height: min(80dvh, 680px); max-height: none; }
.sheet.tsp-sheet.is-form { height: auto; max-height: 88vh; max-height: 88dvh; }
.tsp-sheet .sheet-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.tsp-sheet.is-form .sheet-body { display: block; overflow-y: auto; }
.tsp-search {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  margin: 2px 16px 6px; padding: 0 4px 0 12px; height: 46px;
  border-radius: 12px; background: var(--gray-100); border: 1.5px solid transparent;
}
.tsp-search:focus-within { background: white; border-color: #0891b2; box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15); }
.tsp-search > .material-icons { color: var(--gray-400); font-size: 21px; }
/* 16px 未満だと iPhone が入力時に拡大する */
.tsp-search-input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--gray-800); outline: none; }
.tsp-search-input::-webkit-search-cancel-button { display: none; }
.tsp-search-clear { border: 0; background: none; color: var(--gray-400); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.tsp-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; }
.tsp-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 10px;
  border: 0; border-radius: 12px; background: none; font: inherit; color: var(--gray-800); text-align: left; cursor: pointer;
}
.tsp-item:not(:disabled):active { background: #ecfeff; }
@media (hover: hover) { .tsp-item:not(:disabled):hover { background: #f0fdff; } }
.tsp-item:disabled { cursor: default; }
.tsp-item.is-off .tsp-avatar, .tsp-item.is-off .tsp-main { opacity: 0.5; }
.tsp-avatar { width: 40px; height: 40px; border-radius: 50%; color: white; font-weight: 700; font-size: 1rem; display: grid; place-items: center; flex-shrink: 0; }
.tsp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tsp-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-weight: 700; font-size: 1rem; white-space: nowrap; }
.tsp-kana { font-size: 0.74rem; font-weight: 400; color: var(--gray-400); overflow: hidden; text-overflow: ellipsis; }
.tsp-sub { font-size: 0.78rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsp-add {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  color: #0e7490; background: #ecfeff; border: 1.5px solid #a5f3fc;
}
.tsp-add .material-icons { font-size: 22px; }
.tsp-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; color: var(--gray-500); background: var(--gray-100); }
.tsp-chip.done { color: #047857; background: #d1fae5; }
.tsp-chip .material-icons { font-size: 15px; }
.tsp-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--gray-500); font-size: 0.9rem; }
.tsp-state > .material-icons { font-size: 38px; color: var(--gray-300); }
.tsp-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; margin-top: 2px;
  border: 0; border-radius: 999px; background: #0e7490; color: white; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.tsp-pill .material-icons { font-size: 19px; }
.tsp-foot { flex-shrink: 0; padding: 10px 16px 12px; border-top: 1px solid var(--gray-100); background: white; }
.tsp-sheet.is-form .tsp-foot { border-top: 0; padding-top: 4px; }
.tsp-manual-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 46px;
  border: 1.5px dashed var(--gray-300); border-radius: 12px; background: white; color: var(--gray-600, #4b5563);
  font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.tsp-manual-btn .material-icons { font-size: 19px; }
.tsp-spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(8, 145, 178, 0.25); border-top-color: #0891b2; border-radius: 50%; animation: spin 0.8s linear infinite; }

/* 名簿にいない人の入力欄 */
.tsp-form { padding: 0 16px 4px; }
.tsp-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 6px -2px; padding: 6px 2px; border: 0; background: none; color: #0e7490; font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.tsp-back .material-icons { font-size: 19px; }
.tsp-field { display: block; margin-bottom: 10px; }
.tsp-label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 0.8rem; font-weight: 600; color: var(--gray-600, #4b5563); }
.tsp-req { padding: 0 6px; border-radius: 999px; font-size: 0.66rem; font-weight: 700; color: #b91c1c; background: #fee2e2; }
.tsp-input {
  width: 100%; height: 46px; box-sizing: border-box; padding: 0 12px;
  border: 1.5px solid var(--gray-200); border-radius: 10px; background: white; font: inherit; font-size: 16px; color: var(--gray-800);
}
.tsp-input:focus { outline: none; border-color: #0891b2; box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15); }
.tsp-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px;
  border: 0; border-radius: 12px; background: #0e7490; color: white; font: inherit; font-weight: 700; font-size: 0.98rem; cursor: pointer;
}
.tsp-submit:disabled { background: var(--gray-200); color: var(--gray-400); cursor: default; }
.tsp-submit .tsp-spinner { border-color: rgba(255, 255, 255, 0.35); border-top-color: white; }

/* 臨時スタッフの詳細シートのボタン */
.temp-detail-actions { display: flex; gap: 8px; margin-top: 16px; }
.temp-detail-actions .sheet-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; }
.temp-detail-actions .sheet-btn .material-icons { font-size: 19px; }
.sheet-btn.danger-outline { color: var(--danger-color); border-color: #fecaca; }

/* 集計テーブルの臨時スタッフ行 */
.attendance-table .spot-coach-row .sticky-name {
  background: #ecfeff;
}

.attendance-table .spot-coach-row:hover .sticky-name {
  background: #cffafe;
}

.attendance-table .spot-coach-row td {
  font-size: 0.85rem;
}

/* 臨時スタッフの名前（集計セル内） */
.spot-coach-names-cell {
  padding: 4px 6px !important;
  text-align: left !important;
  vertical-align: top !important;
  line-height: 1.3;
}

.spot-coach-name-entry {
  font-size: 0.8rem;
  white-space: nowrap;
}

.spot-coach-name-entry + .spot-coach-name-entry {
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px dotted #e0e0e0;
}

.spot-coach-furigana {
  display: inline-block;
  font-size: 0.65rem;
  color: #888;
  margin-left: 4px;
}
.spot-coach-note {
  display: block;
  font-size: 0.62rem;
  color: #888;
  font-weight: 400;
  white-space: normal;
  word-break: break-all;
  line-height: 1.3;
  margin-top: 1px;
}

/* ============================================
   2026-09 UI刷新
   ヘッダー教室切替・日付バー・会員/指導者タブ・チップ・
   ボトムシート・オフライン・連続欠席
   ============================================ */
[hidden] { display: none !important; }
:root { --header-h: 56px; }

/* ヘッダーのタイトル＝教室・ビュー切り替えボタン */
.header-title { min-width: 0; flex: 1; }
.header-title-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  border: 0; background: rgba(255, 255, 255, 0.16); color: white;
  font: inherit; font-weight: 700; font-size: 1rem; padding: 6px 8px; border-radius: 10px; cursor: pointer;
}
.header-title-btn #app-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-title-btn .material-icons { font-size: 20px; flex-shrink: 0; }
.header-title-btn .chev { font-size: 18px; opacity: 0.85; }
.header-title-btn.single { background: transparent; cursor: default; }
.header-title-btn.single .chev { display: none; }

/* 出欠タブ上部の固定バー */
.att-sticky {
  position: sticky; top: var(--header-h); z-index: 90; background: white;
  margin: -20px -20px 12px; border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 6px 12px -8px rgba(15, 23, 42, 0.12);
}
.date-bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px 4px; }
.date-nav-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--gray-200); background: var(--gray-50);
  color: var(--gray-700); display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.date-nav-btn:disabled { opacity: 0.35; cursor: default; }
.date-center { flex: 1; min-width: 0; border: 0; background: transparent; text-align: center; padding: 2px 4px; cursor: pointer; line-height: 1.2; font: inherit; }
.date-main { display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 1.05rem; font-weight: 700; color: var(--gray-800); }
.date-main .material-icons { font-size: 18px; color: var(--gray-400); }
.today-tag { font-size: 0.62rem; font-weight: 700; color: #4338ca; background: #eef2ff; padding: 1px 6px; border-radius: 999px; }
.date-venue { display: block; font-size: 0.72rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; min-height: 1em; }
.date-today-btn {
  height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid #c7d2fe; background: #eef2ff; color: #4338ca;
  font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; flex-shrink: 0;
}

.att-tabs { display: flex; gap: 6px; padding: 2px 10px 8px; }
.att-tabs:empty { display: none; }
.att-tab {
  flex: 1; min-width: 0; border: 2px solid var(--gray-200); border-radius: 12px; background: var(--gray-50);
  padding: 6px 6px 5px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--gray-500); cursor: pointer; font: inherit;
}
.att-tab.active { background: white; border-color: #4f46e5; color: #3730a3; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15); }
.att-tab-label { font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.att-tab-label small { font-weight: 500; font-size: 0.74rem; opacity: 0.7; margin-left: 3px; }
.att-tab-stats { display: flex; gap: 8px; font-size: 0.7rem; color: var(--gray-500); white-space: nowrap; line-height: 1.4; }
.att-tab-stats b { font-weight: 700; color: var(--gray-700); margin-left: 1px; }
.att-tab-stats .p b { color: var(--success-dark); }
.att-tab-stats .a b { color: var(--danger-dark); }
.att-tab-un b { color: var(--warning-dark); }
.att-tab-un.done { color: #047857; font-weight: 700; display: inline-flex; align-items: center; gap: 1px; }
.att-tab-un.done .material-icons { font-size: 12px; }

/* 今日の開催日バナー・オフラインバナー */
.today-banner, .offline-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px;
  border-radius: var(--radius-lg); font-size: 0.86rem;
}
.today-banner { background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; }
.today-banner .material-icons { color: #4f46e5; flex-shrink: 0; }
.today-banner > span:not(.material-icons), .offline-banner > span:not(.material-icons) { flex: 1; min-width: 0; }
.today-banner button, .offline-banner button {
  flex-shrink: 0; border: 0; color: white; font: inherit; font-weight: 700; font-size: 0.82rem;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
}
.today-banner button { background: #4f46e5; }
.today-banner button:disabled { opacity: 0.6; cursor: default; }
.offline-banner { background: var(--warning-light); border: 1px solid #fcd34d; color: #78350f; }
.offline-banner.offline { background: #fee2e2; border-color: #fca5a5; color: #7f1d1d; }
.offline-banner .material-icons { flex-shrink: 0; font-size: 20px; }
.offline-banner button { background: #b45309; }

/* チップ（検索・サブクラス・並び順・学年） */
.att-chips { display: flex; gap: 6px; align-items: center; padding: 0 0 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.att-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--gray-200); background: white;
  color: var(--gray-700); font: inherit; font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap;
}
.chip .material-icons { font-size: 16px; color: var(--gray-400); }
.chip.icon-only { width: 34px; padding: 0; justify-content: center; }
.chip.on { background: #eef2ff; border-color: #a5b4fc; color: #3730a3; }
.chip.on .material-icons { color: #4f46e5; }
.att-chips-count { margin-left: auto; flex-shrink: 0; font-size: 0.76rem; font-weight: 700; color: var(--gray-500); padding-left: 6px; white-space: nowrap; }
.att-search { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 0 10px; height: 42px; border: 1px solid #c7d2fe; border-radius: 12px; background: white; }
.att-search .material-icons { font-size: 18px; color: #6366f1; }
.att-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 1rem; background: transparent; color: var(--gray-800); }
.att-search button { border: 0; background: none; color: var(--gray-400); font-size: 1.3rem; line-height: 1; padding: 4px; cursor: pointer; }

/* 出欠エリア */
.attendance-area { position: relative; padding: 12px; }
.attendance-area.loading::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.65); border-radius: var(--radius-xl); z-index: 3; }
.attendance-area.loading::before {
  content: '読み込み中…'; position: absolute; top: 40px; left: 50%; transform: translateX(-50%); z-index: 4;
  font-size: 0.85rem; font-weight: 600; color: var(--gray-500); background: white; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow-md);
}
.attendance-item { padding: 8px 10px; }
.attendance-buttons { flex-shrink: 0; gap: 6px; }
/* 旧モバイル用の width/height:36px を打ち消し、44px の押しやすいボタンにする */
.attendance-btn { width: auto; height: auto; min-width: 64px; min-height: 44px; padding: 0 14px; font-size: 0.92rem; white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.attendance-btn.note-btn, .attendance-btn.unassign-btn { width: 40px; height: 44px; min-width: 40px; padding: 0; border-radius: 999px; }
/* 指導者行はボタンが3〜4個並ぶので少し詰める */
.attendance-item[data-type="coach"] .attendance-btn:not(.note-btn):not(.unassign-btn) { min-width: 56px; padding: 0 10px; }
.attendance-name { flex-wrap: wrap; row-gap: 2px; }
.attendance-name-text { white-space: nowrap; }
.attendance-name .list-item-furigana { white-space: nowrap; }
.you-badge, .pending-badge, .absent-streak, .kintai-badge, .list-item-role, .list-item-subclass, .list-item-grade { white-space: nowrap; }
.attendance-item.is-you { background: #eef4ff; border-left: 4px solid var(--primary-color); }
.attendance-item.is-you.attendance-unchecked { border-left-color: #f59e0b; background: linear-gradient(90deg, #fffbeb 0%, #eef4ff 40%); }
.you-badge { font-size: 0.66rem; font-weight: 700; color: white; background: var(--primary-color); padding: 1px 8px; border-radius: 999px; }
.pending-badge { display: inline-flex; align-items: center; color: #b45309; }
.pending-badge .material-icons { font-size: 16px; }
.absent-streak { display: inline-flex; align-items: center; gap: 2px; font-size: 0.7rem; font-weight: 700; color: #b45309; background: #fef3c7; padding: 1px 8px 1px 5px; border-radius: 999px; }
.absent-streak.high { color: #991b1b; background: #fee2e2; }
.absent-streak .material-icons { font-size: 13px; }
.bulk-present-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; margin-top: 12px;
  border: 2px dashed #a7f3d0; border-radius: var(--radius-lg); background: #ecfdf5; color: #047857;
  font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer;
}
.bulk-present-btn:disabled { border-color: var(--gray-200); background: var(--gray-50); color: var(--gray-400); cursor: default; }
.bulk-present-btn .material-icons { font-size: 20px; }
.att-nudge { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-lg); font-size: 0.88rem; }
.att-nudge.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; }
.att-nudge.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.att-nudge > div { flex: 1; min-width: 0; }
.att-nudge b { display: block; font-size: 0.92rem; }
.att-nudge p { margin: 2px 0 0; font-size: 0.78rem; opacity: 0.85; }
.att-nudge > .material-icons { font-size: 22px; flex-shrink: 0; }
.att-nudge button { flex-shrink: 0; border: 0; background: #b45309; color: white; font: inherit; font-weight: 700; font-size: 0.84rem; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.att-nudge.ok button { background: #059669; }

/* 開催日一覧・確認 */
.list-item.just-saved { border-color: #f59e0b; animation: just-saved-flash 1.6s ease-out; }
@keyframes just-saved-flash { 0% { background: #fef3c7; } 100% { background: white; } }
.list-item.event-dup { border-color: #fecaca; }
.dup-badge { font-size: 0.66rem; font-weight: 700; color: #b91c1c; background: #fee2e2; padding: 1px 6px; border-radius: 999px; margin-left: 6px; }
.confirm-message { padding: 20px 24px 0; font-size: 0.98rem; line-height: 1.6; color: var(--gray-800); }
.confirm-warn { display: inline-block; margin-top: 8px; padding: 6px 10px; background: #fee2e2; color: #991b1b; border-radius: 8px; font-size: 0.86rem; font-weight: 600; }
.confirm-note { display: inline-block; margin-top: 8px; font-size: 0.84rem; color: var(--gray-500); }
#confirm-modal .form-actions { padding: 18px 24px 24px; margin-top: 16px; }
.btn-save.saving, .btn-save:disabled { opacity: 0.7; cursor: not-allowed; filter: saturate(0.6); transform: none; }
.spin-inline { font-size: 18px; vertical-align: middle; margin-right: 4px; animation: spin 1s linear infinite; }

/* トーストのアクションボタン */
.toast .toast-text { flex: 1; line-height: 1.45; }
.toast { cursor: pointer; }

/* 通知・リンクから開いたときの目印（移動先の行・案内を一瞬囲む） */
.link-focus { animation: link-focus 2s ease-out; }
@keyframes link-focus {
  0%, 35% { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.55); }
  100% { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0); }
}
.toast-close { border: 0; background: rgba(255, 255, 255, 0.18); color: white; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; cursor: pointer; flex-shrink: 0; }
.toast-close .material-icons { font-size: 18px; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.18); color: white; font: inherit; font-weight: 700; font-size: 0.84rem; padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; margin-left: 4px; }

/* ボトムシート・確認ダイアログ */
.sheet-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 1200; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn 0.15s ease; }
.sheet-overlay.center { align-items: center; padding: 20px; }
.sheet {
  background: white; border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; max-height: 78vh; display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2); animation: slideUp 0.25s ease; padding-bottom: env(safe-area-inset-bottom);
}
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--gray-300); margin: 8px auto 0; flex-shrink: 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 6px 18px; font-weight: 700; color: var(--gray-800); flex-shrink: 0; }
.sheet-close { border: 0; background: none; color: var(--gray-400); cursor: pointer; padding: 6px; border-radius: 50%; display: grid; place-items: center; }
.sheet-body { overflow-y: auto; padding-bottom: 8px; }
.sheet-group { padding: 10px 18px 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--gray-400); }
.sheet-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 12px 18px; font: inherit; font-size: 0.98rem; color: var(--gray-800); text-align: left; cursor: pointer; }
.sheet-item:active { background: var(--gray-50); }
.sheet-item.selected { background: #eef2ff; color: #3730a3; font-weight: 700; }
.sheet-item:disabled { opacity: 0.45; cursor: default; }
.sheet-item-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sheet-item-label { display: flex; align-items: center; gap: 6px; }
.sheet-item-sub { font-size: 0.76rem; color: var(--gray-500); font-weight: 400; }
.sheet-badge { font-size: 0.68rem; font-weight: 700; color: white; background: #4338ca; padding: 1px 8px; border-radius: 999px; }
.sheet-check { font-size: 22px; color: #4338ca; width: 24px; text-align: center; flex-shrink: 0; }
.sheet-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--gray-100); flex-shrink: 0; }
.sheet-btn { padding: 11px 16px; border-radius: 10px; border: 1px solid var(--gray-200); background: white; color: var(--gray-700); font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; }
.sheet-btn.primary { background: #4f46e5; border-color: #4f46e5; color: white; }
.sheet-btn.danger { background: var(--danger-color); border-color: var(--danger-color); color: white; }
.dialog { background: white; border-radius: 16px; width: 100%; max-width: 380px; padding: 20px 20px 16px; box-shadow: var(--shadow-2xl); animation: slideUp 0.2s ease; }
.dialog-title { font-weight: 700; font-size: 1.05rem; color: var(--gray-800); margin-bottom: 8px; }
.dialog-body { font-size: 0.95rem; color: var(--gray-700); line-height: 1.6; }
.dialog-body b { color: var(--gray-900); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
body.sheet-open { overflow: hidden; }

/* オフラインでログインを確認できないときの案内 */
.offline-gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--gray-700); }
.offline-gate .material-icons { font-size: 48px; color: var(--gray-400); }
.offline-gate button { margin-top: 8px; padding: 12px 20px; border: 0; border-radius: 10px; background: var(--primary-color); color: white; font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 600px) {
  .att-sticky { margin: -12px -12px 10px; }
  .header-title-btn { font-size: 0.95rem; padding: 5px 6px; }
  .attendance-area { padding: 8px; }
  .account-name-text { display: none; }
}

/* ============================================
   2026-09-11 第2弾: 減量・ナビ・詳細・PWA案内・他画面の整理
   ============================================ */
.header-app-icon { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; }
.date-sub { display: block; font-size: 0.72rem; color: var(--gray-500); margin-top: 1px; }

/* タブは「名前＋人数」と「未入力 N」だけ */
.att-tab { flex-direction: row; justify-content: center; align-items: center; gap: 8px; height: 44px; padding: 0 8px; }
.att-tab-label { font-size: 0.95rem; }
.att-tab-stats { display: none; }
.att-tab-un { display: inline-flex; align-items: center; gap: 2px; font-size: 0.74rem; font-weight: 700; color: #b45309; background: #fef3c7; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.att-tab-un b { color: inherit; margin-left: 2px; }
.att-tab-un.done { color: #047857; background: #d1fae5; padding: 2px 6px; }
.att-tab-un.done .material-icons { font-size: 14px; }
.att-tab:not(.active) .att-tab-un { opacity: 0.85; }

/* 会場・出席/欠席はリスト上部の帯へ */
.att-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; font-size: 0.78rem; color: var(--gray-500); }
.att-strip-venue { display: inline-flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-strip-venue .material-icons { font-size: 15px; color: var(--gray-400); }
.att-strip-stats { display: inline-flex; gap: 10px; white-space: nowrap; }
.att-strip-stats b { margin-left: 2px; font-weight: 700; }
.att-strip-stats .p b { color: var(--success-dark); }
.att-strip-stats .a b { color: var(--danger-dark); }
.chip.icon-only { position: relative; }
.chip-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #4f46e5; }

/* 名前をタップで詳細 */
.attendance-name-area { cursor: pointer; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
.attendance-name-area:active { background: rgba(79, 70, 229, 0.06); }

/* 開催日一覧の「今日」 */
.today-badge { font-size: 0.66rem; font-weight: 700; color: white; background: #4338ca; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

/* 電話番号タップで発信 */
.tel-link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary-dark); font-weight: 600; text-decoration: none; padding: 6px 12px; border: 1px solid var(--primary-light); background: var(--primary-lighter); border-radius: 999px; }
.tel-link .material-icons { font-size: 18px; }

/* ボトムシート内の詳細・PWA案内 */
.sheet-body-custom { padding: 4px 18px 18px; }
.sheet-body-custom .detail-modal-body { padding: 0; }
.pwa-sheet { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 4px; }
.pwa-icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow-md); }
.pwa-lead { margin: 0; font-size: 0.92rem; color: var(--gray-700); line-height: 1.6; }
.pwa-steps { margin: 4px 0 0; padding: 0 0 0 1.4em; text-align: left; font-size: 0.9rem; color: var(--gray-700); line-height: 1.7; }
.pwa-steps .material-icons { font-size: 18px; vertical-align: middle; color: var(--primary-color); }
.pwa-note { margin: 0; font-size: 0.85rem; color: var(--gray-500); }
.pwa-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }
.pwa-actions .sheet-btn { width: 100%; padding: 13px 16px; }
.pwa-actions .pwa-link { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.pwa-arrow { display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 4px; color: #4f46e5; font-size: 0.82rem; font-weight: 700; }
.pwa-arrow .material-icons { font-size: 28px; animation: pwa-bounce 1.2s ease-in-out infinite; }
@keyframes pwa-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .pwa-arrow .material-icons { animation: none; } }

/* 「アプリとして追加」の帯（PC の Chrome / Edge・js/pwa-install.js）。ヘッダーの下に並べて置き、重ねない */
.install-banner { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 20px; background: var(--primary-lighter); border-bottom: 1px solid var(--primary-light); color: var(--gray-800); }
.install-banner-icon { border-radius: 8px; flex-shrink: 0; }
.install-banner-text { flex: 1; min-width: 0; margin: 0; font-size: 0.88rem; line-height: 1.5; word-break: auto-phrase; }
.install-banner-add { flex-shrink: 0; white-space: nowrap; border: 0; border-radius: 999px; background: var(--primary-color); color: white; font: inherit; font-size: 0.85rem; font-weight: 700; padding: 6px 16px; cursor: pointer; }
.install-banner-add:hover { background: var(--primary-dark); }
.install-banner-close { flex-shrink: 0; display: inline-flex; border: 0; border-radius: 999px; background: transparent; color: var(--gray-500); padding: 6px; cursor: pointer; }
.install-banner-close:hover { background: var(--primary-light); color: var(--gray-700); }
.setting-card { padding: 14px 16px; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: white; margin-top: 16px; }
.setting-card h3 { margin: 0 0 6px; font-size: 1rem; }
.setting-card p { margin: 0 0 10px; font-size: 0.86rem; color: var(--gray-500); }
.setting-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.push-last-error { margin: -4px 0 10px; padding: 8px 10px; background: #fee2e2; color: #991b1b; border-radius: 8px; font-size: 0.8rem; word-break: break-all; }
.push-diag { margin: -4px 0 10px; font-size: 0.72rem; color: var(--gray-400); word-break: break-all; }

/* ============================================
   通知（ベル・インボックス・種類の設定）
   ============================================ */
.notify-bell { position: relative; }
.notify-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger-color); color: white;
  font-size: 0.66rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.9);
}
.notify-inbox-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.notify-inbox-actions .sheet-btn { flex: 1; padding: 10px 12px; font-size: 0.86rem; }
.notify-inbox-actions .sheet-btn:disabled { opacity: 0.45; }
.notify-inbox-note {
  flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 0.78rem; color: var(--gray-500);
}
.notify-inbox-note .material-icons { font-size: 17px; color: #4f46e5; flex-shrink: 0; }
.notify-list { display: flex; flex-direction: column; gap: 6px; }
.notify-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 12px; border: 1px solid var(--gray-200); border-radius: 12px; background: white; font: inherit;
}
.notify-item.unread { border-color: #c7d2fe; background: #f5f7ff; }
.notify-item:active { background: var(--gray-50); }
.notify-item-icon { font-size: 20px; color: var(--gray-400); flex-shrink: 0; margin-top: 1px; }
.notify-item.unread .notify-item-icon { color: #4f46e5; }
.notify-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notify-item-title { font-weight: 700; font-size: 0.9rem; color: var(--gray-800); }
.notify-item.unread .notify-item-title::after {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #4f46e5; margin-left: 6px; vertical-align: middle;
}
.notify-item-body { font-size: 0.8rem; color: var(--gray-600); white-space: pre-wrap; }
.notify-item-time { font-size: 0.72rem; color: var(--gray-400); }
.notify-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 12px; color: var(--gray-400); font-size: 0.9rem; }
.notify-empty .material-icons { font-size: 40px; color: var(--gray-300); }
.notify-prefs-lead { margin: 0 0 12px; font-size: 0.84rem; color: var(--gray-500); line-height: 1.6; }
.notify-pref { border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.notify-pref-head { display: flex; gap: 10px; align-items: flex-start; }
.notify-pref-head .material-icons { font-size: 20px; color: #4f46e5; flex-shrink: 0; margin-top: 1px; }
.notify-pref-head b { font-size: 0.92rem; color: var(--gray-800); }
.notify-pref-head p { margin: 2px 0 0; font-size: 0.78rem; color: var(--gray-500); line-height: 1.5; }
.notify-pref-channels { display: flex; flex-direction: column; margin-top: 8px; padding-left: 30px; }
.notify-ch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; }
.notify-ch + .notify-ch { border-top: 1px solid var(--gray-100); }
.notify-ch-name { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; color: var(--gray-700); font-weight: 600; }
.notify-ch-name .material-icons { font-size: 18px; color: var(--gray-400); }
.notify-disabled-banner {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; padding: 10px 12px;
  background: var(--warning-light); border: 1px solid #fcd34d; border-radius: 12px;
  font-size: 0.82rem; color: #78350f; line-height: 1.6;
}
.notify-disabled-banner .material-icons { font-size: 18px; flex-shrink: 0; }

/* トグルスイッチ（チェックボックスの代わり） */
.switch { position: relative; display: inline-flex; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: relative; width: 46px; height: 27px; border-radius: 999px;
  background: var(--gray-300); transition: background 0.18s ease; pointer-events: none;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch-track { background: #4f46e5; }
.switch input:checked + .switch-track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--mark, #eb6600); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .switch-track, .switch-track::after { transition: none; }
}
.notify-prefs-actions { margin-top: 12px; }
.notify-prefs-actions .sheet-btn { width: 100%; padding: 13px 16px; }

/* 会員／指導者タブ: 灰色のトラックに白抜きの選択中（2つ並んでいることが一目で分かる） */
.att-tabs {
  gap: 4px;
  margin: 2px 10px 8px;
  padding: 4px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
}
.att-tab {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--gray-600);
  box-shadow: none;
}
.att-tab:not(.active):active { background: rgba(15, 23, 42, 0.06); }
.att-tab.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-colored);
}
.att-tab.active .att-tab-label { color: white; }
.att-tab.active .att-tab-label small { opacity: 0.85; }
.att-tab.active .att-tab-un { background: rgba(255, 255, 255, 0.92); color: #b45309; }
.att-tab.active .att-tab-un.done { background: rgba(255, 255, 255, 0.92); color: #047857; }
.att-tab.active .att-tab-un.neutral { background: rgba(255, 255, 255, 0.25); color: white; }

/* メンバー画面のタブ（出欠と同じ部品を流用） */
.members-top .att-tabs { margin-top: 8px; }
#members-section .sub-tab-panel { padding-top: 2px; }
.coaches-panel-header { justify-content: space-between; }
.section-note { font-size: 0.8rem; color: var(--gray-500); }
.login-app-icon { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 12px; display: block; box-shadow: var(--shadow-lg); }

/* タッチ端末では hover の浮き上がりを無効化（スクロール時のチラつき防止） */
@media (hover: none) {
  .list-item:hover { transform: none; box-shadow: var(--shadow-sm); border-color: transparent; }
  .list-item:hover::before { opacity: 0; }
  .attendance-btn.present:hover:not(.active), .attendance-btn.absent:hover:not(.active) { transform: none; background: white; }
}

/* 下タブ中央の「出欠」を少し目立たせる（一番使うタブ・両手の親指が届く位置） */
.nav-btn-primary .material-icons { font-size: 26px; }
.nav-btn-primary .material-icons { background: var(--primary-lighter); color: var(--primary-color); border-radius: 999px; padding: 4px 14px; }
.nav-btn-primary.active .material-icons { background: var(--primary-gradient); color: white; box-shadow: var(--shadow-colored); }
.nav-btn-primary span:not(.material-icons) { font-weight: 700; }

/* ============================================
   集計タブ: 期間バー・KPI・タブ・チップ・テーブルの見た目
   （記号 ○×― と表の内容は変えない＝画像出力の中身は同じ）
   ============================================ */
.period-bar .export-dropdown { flex-shrink: 0; margin-left: 2px; }
.export-btn {
  height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid #c7d2fe; background: #eef2ff; color: #4338ca;
  font: inherit; font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap;
}
.export-btn .material-icons { font-size: 18px; }
.export-dropdown.open .export-btn { background: #4338ca; color: white; border-color: #4338ca; }
.export-menu { min-width: 170px; }
/* ひと目の数字は1行の帯（表が早く見えるように） */
.summary-kpi { display: flex; justify-content: space-around; align-items: center; gap: 8px; margin-bottom: 8px; padding: 7px 10px; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.summary-kpi:empty { display: none; }
.kpi { display: inline-flex; align-items: baseline; gap: 5px; }
.kpi-value { font-size: 1.05rem; font-weight: 700; color: var(--gray-800); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 0.68rem; font-weight: 600; color: var(--gray-500); margin-left: 1px; }
.kpi-label { font-size: 0.72rem; color: var(--gray-500); font-weight: 600; }

/* 画面では重複する見出しを隠し、画像出力（.capturing）のときだけ従来どおり表示する */
.summary-area .summary-header-bar { display: none; }
.summary-area.capturing .summary-header-bar { display: flex; }
.summary-area .section-card .section-header { display: none; }
.summary-area.capturing .section-card .section-header { display: block; }
.summary-area .event-details-section { padding: 6px 12px; margin-bottom: 8px; font-size: 0.8rem; }
.summary-area .section-card { margin-bottom: 10px; }
.summary-area .legend-bar { padding: 6px 12px; }
.att-tab-un.neutral { color: var(--gray-600); background: var(--gray-100); }
.att-tab.active .att-tab-un.neutral { color: #3730a3; background: #eef2ff; }
#summary-chips:empty { display: none; }

.summary-header-bar { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 10px 14px; margin-bottom: 10px; }
.summary-header-bar .summary-info { font-size: 0.9rem; color: var(--gray-600); }
.summary-header-bar .summary-info strong { font-size: 1rem; color: var(--gray-800); }
.section-card { border-radius: var(--radius-lg); box-shadow: none; margin-bottom: 12px; }
.section-card .section-header { padding: 10px 14px; background: white; margin-bottom: 0; }
.section-card .section-title { font-size: 0.9rem; }
.attendance-table { font-size: 0.88rem; }
.attendance-table th, .attendance-table td { padding: 7px 4px; border-bottom: 1px solid var(--gray-100); }
.attendance-table thead th { background: var(--gray-50); font-size: 0.74rem; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); }
.attendance-table .date-col { padding: 6px 4px; }
.date-col-date { font-size: 0.88rem; font-weight: 700; color: var(--gray-800); line-height: 1.2; }
.date-col-dow { font-size: 0.62rem; font-weight: 600; color: var(--gray-400); line-height: 1.2; }
.date-col-dow.sat { color: #2563eb; }
.date-col-dow.sun { color: #dc2626; }
.attendance-table .sticky-name { box-shadow: 4px 0 8px -6px rgba(15, 23, 42, 0.25); width: 124px; min-width: 124px; max-width: 124px; }
.attendance-table .data-row:nth-child(even) td { background: #fbfbfd; }
.attendance-table .status { font-size: 1rem; }
.attendance-table .status.present { color: #059669; }
.attendance-table .status.absent { color: #dc2626; }
.attendance-table .status.unknown { color: #d1d5db; }
.attendance-table .col-count { background: #f8fafc; color: var(--gray-800); }
.person-name-main { font-size: 0.88rem; }
.legend-bar { font-size: 0.78rem; padding: 8px 12px; gap: 14px; background: transparent; }

/* 教室切替シート: アバター・種別バッジ・説明 */
.sheet-subtitle { padding: 0 18px 8px; font-size: 0.78rem; color: var(--gray-500); }
.sheet-item.has-avatar { padding-top: 10px; padding-bottom: 10px; }
.sheet-avatar { width: 38px; height: 38px; border-radius: 11px; color: white; font-weight: 700; font-size: 0.82rem; display: grid; place-items: center; flex-shrink: 0; letter-spacing: 0.02em; }
.sheet-item.selected .sheet-avatar { box-shadow: 0 0 0 2px white, 0 0 0 4px #4338ca; }

/* 他画面の軽い整理（ロジックは変更なし） */
.section-header { margin-bottom: 12px; }
.sub-tabs { margin-bottom: 12px; padding: 3px; }
.sub-tab-btn { padding: 9px 12px; font-size: 0.9rem; }
.toolbar { border: 0; box-shadow: none; background: transparent; margin-bottom: 8px; }
.toolbar-row { padding: 0; }
.toolbar.open .toolbar-filter-panel { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); margin-top: 6px; background: white; }
.period-selector { margin-bottom: 8px; }


/* ============================================
   振替・体験の子（管理システムの申請から表示）
   ============================================ */
.guest-section-header {
  display: flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
  border-left: 3px solid #4f46e5 !important;
  color: #3730a3 !important;
}
.guest-section-header .material-icons { font-size: 15px; }
.guest-members-header { margin-top: 12px; }
.guest-badge {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.03em; color: white; vertical-align: middle; white-space: nowrap;
}
.guest-badge.transfer { background: #4f46e5; }
.guest-badge.trial { background: #059669; }
.guest-from { font-size: 0.75rem; color: #4338ca; white-space: nowrap; }
.guest-detail-note { margin: 12px 0 0; font-size: 0.78rem; color: var(--gray-500); line-height: 1.6; }
.transfer-out-badge {
  display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
  font-size: 0.7rem; font-weight: 700; color: #3730a3; background: #e0e7ff;
  padding: 1px 8px 1px 5px; border-radius: 999px;
}
.transfer-out-badge .material-icons { font-size: 13px; }

/* ============================================
   開催日の時点の名簿（休会・退会・復会・入会の印、休会中の欄）
   ============================================ */
.roster-badge {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px;
}
.roster-badge.withdraw { color: #9f1239; background: #ffe4e6; }
.roster-badge.suspend { color: #6b21a8; background: #f3e8ff; }
.roster-badge.return { color: #047857; background: #d1fae5; }
.roster-badge.join { color: #b45309; background: #fef3c7; }
.roster-badge.muted { color: var(--gray-500); background: var(--gray-100, #f3f4f6); }
.suspended-section { margin-top: 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: #fafafa; }
.suspended-section summary {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px; cursor: pointer; list-style: none;
  font-size: 0.85rem; font-weight: 700; color: var(--gray-600, #4b5563);
}
.suspended-section summary::-webkit-details-marker { display: none; }
.suspended-section summary .material-icons { font-size: 18px; }
.suspended-section .suspended-chevron { margin-left: auto; transition: transform 0.2s; }
.suspended-section[open] .suspended-chevron { transform: rotate(180deg); }
.suspended-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  padding: 8px 14px; border-top: 1px solid var(--gray-100, #f3f4f6); color: var(--gray-600, #4b5563);
}
.suspended-name { font-weight: 600; }
.suspended-note { font-size: 0.75rem; color: #6b21a8; white-space: nowrap; }

/* 教室切替シートの補足（担当教室だけ表示しているとき）と、1教室の人向けの説明 */
.sheet-note {
  display: flex; align-items: flex-start; gap: 6px; flex-shrink: 0;
  padding: 10px 18px 14px; border-top: 1px solid var(--gray-100); font-size: 0.8rem; color: var(--gray-600, #4b5563); line-height: 1.55;
}
.sheet-note .material-icons { font-size: 17px; color: #4f46e5; margin-top: 1px; flex-shrink: 0; }
.view-help { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 4px; }
.view-help .view-help-icon { font-size: 30px; color: #4f46e5; background: #eef2ff; border-radius: 50%; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.view-help-lead { margin: 0; font-size: 0.98rem; color: var(--gray-800); line-height: 1.6; }
.view-help-lead b { color: #3730a3; }
.view-help-text { margin: 0; font-size: 0.88rem; color: var(--gray-600, #4b5563); line-height: 1.7; text-align: left; }

/* 出欠を読み込めなかったとき（「読み込み中…」のまま止めずに、やり直しボタンを出す） */
.att-load-error {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 40px 24px; border: 2px dashed var(--gray-200); border-radius: var(--radius-lg); background: var(--gray-50);
  color: var(--gray-600, #4b5563); font-size: 0.95rem; line-height: 1.6;
}
.att-load-error > .material-icons { font-size: 40px; color: var(--gray-400); }
.att-load-error p { margin: 0; }
.att-load-error .att-load-error-title { font-weight: 700; color: var(--gray-700); }
.att-load-error button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px; margin-top: 4px;
  border: 0; border-radius: 999px; background: var(--primary-color); color: white; font: inherit; font-weight: 700; cursor: pointer;
}
.att-load-error button .material-icons { font-size: 20px; }
