/* ========================================
   基本設定（両ページ共通）
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #cee6f1 0%, #b8e0d4 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 55px; /* ハンバーガーメニュー用の最小限の余白 */
}

/* ========================================
   セクション見出し（両ページ共通）
   ======================================== */
.section-title {
  font-size: 1.6em;
  margin-bottom: 20px;
  color: #333;
  font-weight: 700;
  padding-left: 10px;
  border-left: 5px solid #667eea;
}

/* ========================================
   アコーディオンフィルター（両ページ共通）
   ======================================== */
.filter-header {
  background: linear-gradient(135deg, #f5f5f5 0%, #ececec 100%);
  padding: 6px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  transition: background 0.3s;
}

.filter-header:hover {
  background: linear-gradient(135deg, #ececec 0%, #e0e0e0 100%);
}

.filter-header-title {
  font-weight: 600;
  color: #333;
  font-size: 1em;
}

.filter-toggle-icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* 横棒（常に表示） */
.filter-toggle-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2.5px;
  background: #333;
  transform: translate(-50%, -50%);
}

/* 縦棒（閉じた状態のときのみ表示） */
.filter-toggle-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5px;
  height: 16px;
  background: #333;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s;
}

/* 開いた状態では縦棒を消す */
.filter-header.active .filter-toggle-icon::after {
  opacity: 0;
}

.filter-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.filter-content.open {
  max-height: 700px;
}

.filter-inner {
  padding: 20px;
  background: white;
}

/* フィルター内のボタングループ */
.filter-group {
  margin-bottom: 20px;
  position: relative;
}

.filter-group:last-of-type {
  margin-bottom: 15px;
}

.filter-group-label {
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
  display: block;
  font-size: 0.95em;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* フィルターボタン（チップスタイル） */
.filter-chip {
  padding: 10px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  user-select: none;
  font-size: 0.9em;
}

.filter-chip:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.filter-chip.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
}

/* 承認ツールチップ */
.approval-tooltip {
  display: inline;
  margin-left: 4px;
}

.approval-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: bold;
  color: #999;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
  list-style: none;
}

.approval-tooltip-icon::-webkit-details-marker {
  display: none;
}

.approval-tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 220px;
  padding: 8px 10px;
  background: #333;
  color: #fff;
  font-size: 12px;
  font-weight: normal;
  line-height: 1.5;
  border-radius: 6px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* フィルター内のアイコン表示 */
.filter-icon {
  font-size: 1.1em;
  margin-right: 5px;
}

/* ========================================
   承認フィルター（両ページ共通）
   ======================================== */
.approval-options {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
}

.approval-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

/* 丸のインケーター */
.approval-indicator {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  background: white;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
}

.approval-item:hover .approval-indicator {
  border-color: #667eea;
}

/* 選択時：紫で埋まる */
.approval-item.selected .approval-indicator {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 選択時：中央に白い小さな丸 */
.approval-item.selected .approval-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.approval-label {
  font-weight: 500;
  font-size: 0.95em;
  color: #333;
}

/* ========================================
   フィルター適用ボタンとエラー（両ページ共通）
   ======================================== */
.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.filter-record-count {
  font-size: 0.9em;
  color: #666;
  text-align: center;
}

.filter-record-count.error {
  color: #d32f2f;
}

.filter-error {
  color: #d32f2f;
  font-size: 0.85em;
  text-align: center;
  display: none;
}

.filter-error.show {
  display: block;
}

.apply-filter-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.apply-filter-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.apply-filter-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ========================================
   テーブル共通構造
   ======================================== */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

th {
  text-align: left;
  font-weight: 600;
  user-select: none;
}

tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s;
}

tbody tr:hover {
  background-color: #f5f5f5;
}

tbody tr:last-child {
  border-bottom: none;
}

/* ========================================
   ステータスバッジ（両ページ共通）
   ======================================== */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: 600;
}

.status-approved {
  background: #d4edda;
  color: #155724;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

/* ========================================
   動画リンクボタン（両ページ共通）
   ======================================== */
.video-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.3s;
}

.video-link:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   空状態（両ページ共通）
   ======================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state-icon {
  font-size: 4em;
  margin-bottom: 20px;
}

.empty-state h2 {
  font-size: 1.8em;
  margin-bottom: 10px;
  color: #333;
}

.empty-state p {
  font-size: 1.1em;
}

/* ========================================
   ナビゲーション（旧 navigation.js から移動）
   ======================================== */

/* ハンバーガーボタン */
.hamburger-btn {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  width: 50px;
  height: 50px;
  background: white;
  border: none;
  border-radius: 0 0 0 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* メニュー開閉時にボタンを非表示 */
.hamburger-btn.active {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ホバー時の拡大効果 */
.hamburger-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ハンバーガーアイコンの線 */
.hamburger-line {
  width: 24px;
  height: 3px;
  background: #667eea;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* メニュー開閉時のアイコンアニメーション（×印への変形） */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* オーバーレイ（背景の暗転） */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(2px);
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* サイドメニュー（右側からスライド） */
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: white;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

/* メニューを表示 */
.side-menu.open {
  transform: translateX(0);
}

/* メニューヘッダー */
.menu-header {
  padding: 24px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
}

.menu-title {
  font-size: 1.4em;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.menu-subtitle {
  font-size: 0.7em;
  font-weight: 500;
  opacity: 0.95;
}

/* メニューリスト */
.menu-list {
  list-style: none;
  padding: 20px 0;
  margin: 0;
  flex: 1;
}

/* メニュー項目 */
.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

/* 左側のアクセントバー（ホバー・選択時に表示） */
.menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: #667eea;
  transform: scaleY(0);
  transition: transform 0.2s;
}

/* ホバー時の背景色変更 */
.menu-item:hover {
  background: #f5f5f5;
}

/* ホバー・選択時のアクセントバー表示 */
.menu-item:hover::before,
.menu-item.active::before {
  transform: scaleY(1);
}

/* 現在のページ */
.menu-item.active {
  background: #f0f4ff;
  color: #667eea;
  font-weight: 600;
}

.menu-icon {
  font-size: 1.5em;
}

.menu-label {
  font-size: 1.1em;
}

/* メニューフッター */
.menu-footer {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.menu-footer-text {
  font-size: 0.85em;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

.menu-footer-text a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.menu-footer-text a:hover {
  text-decoration: underline;
}

/* ========================================
   フィルター レスポンシブ対応（両ページ共通）
   ======================================== */
@media (max-width: 768px) {
  .filter-header {
    padding: 5px 15px;
  }

  .filter-header-title {
    font-size: 0.85em;
  }

  .filter-inner {
    padding: 15px;
  }

  .filter-group-label {
    font-size: 0.85em;
  }

  .filter-chip {
    padding: 7px 12px;
    font-size: 0.82em;
  }

  .filter-toggle-icon {
    width: 14px;
    height: 14px;
  }

  .filter-toggle-icon::before {
    width: 10px;
    height: 1.5px;
  }

  .filter-toggle-icon::after {
    width: 1.5px;
    height: 10px;
  }

  .approval-indicator {
    width: 16px;
    height: 16px;
  }

  .approval-item.selected .approval-indicator::after {
    width: 6px;
    height: 6px;
  }

  .approval-label {
    font-size: 0.85em;
  }
}

/* ========================================
   補足事項モーダル（両ページ共通）
   ======================================== */
.note-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.note-btn:hover {
  transform: scale(1.1);
}

.note-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.note-modal-overlay.active {
  display: flex;
}

.note-modal {
  background: white;
  border-radius: 10px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
}

.note-modal-title {
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 1em;
  color: #333;
}

.note-modal-body {
  font-size: 0.95em;
  color: #555;
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.note-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

/* ========================================
   ナビゲーション レスポンシブ対応（モバイル）
   ======================================== */
@media (max-width: 600px) {
  .side-menu {
    width: 200px;
  }

  .hamburger-btn {
    top: 0;
    right: 0;
    width: 45px;
    height: 45px;
    border-radius: 0 0 0 10px;
  }

  .menu-item {
    padding: 12px 16px;
    gap: 12px;
  }

  .menu-icon {
    font-size: 1.2em;
  }

  .menu-label {
    font-size: 0.9em;
  }
}
