body {
  font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN', 'Meiryo', 'メイリオ', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: auto; /* 横スクロール有効 */
}

/* メインアプリコンテナ */
.app-container {
  display: flex;
  min-height: 100vh;
  min-width: 100%;
}

/* メインコンテンツエリア */
.main-content {
  flex: 1;
  overflow-x: auto; /* 横スクロール有効 */
  overflow-y: auto; /* 縦スクロール有効 */
  min-width: 0; /* フレックスアイテムの縮小を許可 */
}

/* コンテンツラッパー */
.content-wrapper {
  min-width: 800px; /* 最小幅を確保 */
  padding: 1rem;
}

.sidebar {
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0; /* サイドバーは縮小しない */
}

.sidebar-bottom {
  margin-top: auto;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .content-wrapper {
    min-width: 600px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 4rem !important; /* 小画面では自動で折りたたみ */
  }
  
  .sidebar-text {
    display: none;
  }
  
  .sidebar-bottom {
    display: none;
  }
  
  .content-wrapper {
    min-width: 500px;
  }
}

@media (max-width: 640px) {
  .content-wrapper {
    min-width: 400px;
  }
}

.card {
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-danger:hover {
  background-color: #dc2626;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

table th {
  background-color: #f9fafb;
  font-weight: 600;
}

table tbody tr:hover {
  background-color: #f9fafb;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-graduated {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-withdrawn {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-present {
  background-color: #d1fae5;
  color: #065f46;
}

.status-absent {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-late {
  background-color: #fef3c7;
  color: #92400e;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  ring: 2px;
  ring-color: #3b82f680;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.loading::before {
  content: '';
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading::after {
  content: '読み込み中...';
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 出席簿ボタンスタイル */
.attendance-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
}

.attendance-btn:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.attendance-btn.active {
  border-color: #3b82f6;
  background-color: #eff6ff;
  color: #1e40af;
  font-weight: 600;
}

/* 出席ボタン（緑系） */
.attendance-btn-present.active {
  border-color: #10b981;
  background-color: #d1fae5;
  color: #065f46;
}

.attendance-btn-present:hover {
  border-color: #10b981;
  background-color: #ecfdf5;
}

/* 欠席ボタン（赤系） */
.attendance-btn-absent.active {
  border-color: #ef4444;
  background-color: #fee2e2;
  color: #991b1b;
}

.attendance-btn-absent:hover {
  border-color: #ef4444;
  background-color: #fef2f2;
}

/* 小さいフォーム入力 */
.form-input-sm {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
}

/* メンションタグスタイル */
.mention-tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  margin: 0 0.125rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.mention-tag:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* contenteditable placeholder */
[contenteditable][data-placeholder]:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  cursor: text;
}

[contenteditable]:focus {
  outline: none;
  border-color: #3b82f6;
}

/* =========================================
   カレンダースタイル
   ========================================= */

.calendar-container {
  max-width: 1400px;
  margin: 0 auto;
}

.calendar-grid {
  min-width: 800px;
}

.calendar-day {
  min-height: 120px;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background-color: white;
}

.calendar-day:hover {
  background-color: #f9fafb;
  border-color: #3b82f6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-day.empty {
  background-color: #f9fafb;
  cursor: default;
  border-color: transparent;
}

.calendar-day.empty:hover {
  background-color: #f9fafb;
  border-color: transparent;
  box-shadow: none;
}

.calendar-day.today {
  background-color: #faf5ff;
  border-color: #a855f7;
  border-width: 2px;
}

.calendar-day.today:hover {
  background-color: #f3e8ff;
}

.calendar-day.has-events {
  background-color: #eff6ff;
}

.calendar-day.has-events:hover {
  background-color: #dbeafe;
}

.day-number {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.events-indicator {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.event-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.event-count {
  margin-top: 0.5rem;
  font-weight: 500;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .calendar-day {
    min-height: 100px;
    padding: 0.375rem;
  }
  
  .day-number {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }
  
  .day-number {
    font-size: 0.875rem;
  }
  
  .event-count {
    font-size: 0.625rem;
  }
}

/* コースタブのスタイル */
.course-tab {
  cursor: pointer;
  transition: all 0.2s ease;
}

.course-tab:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

.course-tab-active {
  color: #2563eb !important;
  border-bottom-color: #2563eb !important;
}

/* ==================== Phase 5: アクティビティタブスタイル ==================== */

/* アクティビティタブボタン */
.activity-tab {
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.activity-tab.active {
  background-color: #4f46e5 !important; /* indigo-600 */
  color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-tab:hover:not(.active) {
  background-color: #f3f4f6; /* gray-100 */
}

/* アクティビティコンテンツ */
.activity-content {
  transition: all 0.3s ease;
}

.activity-content.hidden {
  display: none;
}

/* 行の切り詰め */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== Phase 8: クイックアクションボタン ==================== */

.quick-action-btn {
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 150px;
}

.quick-action-btn:active {
  transform: scale(0.98) !important;
}

.quick-action-btn i {
  transition: transform 0.3s ease;
}

.quick-action-btn:hover i {
  transform: scale(1.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .quick-action-btn {
    min-height: 120px;
    padding: 1rem !important;
  }
  
  .quick-action-btn i {
    font-size: 2rem !important;
  }
  
  .quick-action-btn span {
    font-size: 0.875rem !important;
  }
}
