/* 現行CSS衝突防止リセット */
.index2-header {
  max-width: none;
  float: none;
  position: relative;
}
.index2-header h1 {
  float: none;
}
.index2-header,
.histories2-footer {
  background: #fff;
}

/* === histories2.css — histories2専用スタイル === */

/* ===========================
   1. 全体レイアウト
   =========================== */

.histories2-body {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  box-sizing: border-box;
}

.histories2-body *, .histories2-body *::before, .histories2-body *::after {
  box-sizing: border-box;
}

.histories2-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===========================
   2. ヘッダー（index2.cssと共通クラス使用）
   =========================== */

/* index2-header, index2-logo 等は index2.css を読まず
   histories2.css で独立定義する */

.histories2-body .index2-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex-shrink: 0;
}

.histories2-body .index2-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.histories2-body .index2-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
}

.histories2-body .index2-logo {
  margin: 0;
}

.histories2-body .index2-logo img {
  height: 32px;
}

/* ハンバーガーメニュー */
.histories2-body .index2-hamburger-wrap {
  position: relative;
}

.histories2-body .index2-hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #555;
  padding: 4px 8px;
}

.histories2-body .index2-hamburger-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 40px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 8px;
  width: 220px;
  z-index: 200;
}

.histories2-body .index2-hamburger-menu.is-open {
  display: block;
}

.histories2-body .index2-hamburger-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s;
}

.histories2-body .index2-hamburger-menu a:hover {
  background: #f5f5f5;
}

.histories2-body .index2-hamburger-menu a i {
  color: #888;
  width: 16px;
}

/* ログアウトボタン */
.histories2-body .index2-logout-btn {
  background: none;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  font-family: "Noto Sans JP", sans-serif;
}

/* 新規チェックボタン */
.histories2-new-check-btn {
  background: #2196F3;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  font-family: "Noto Sans JP", sans-serif;
  transition: opacity 0.15s;
}

.histories2-new-check-btn:hover {
  opacity: 0.9;
}

.histories2-new-check-btn i {
  margin-right: 4px;
}

/* ===========================
   3. メインエリア
   =========================== */

.histories2-main {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.histories2-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin: 0 0 16px;
}

/* ===========================
   4. フィルターバー
   =========================== */

.histories2-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.histories2-filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-family: "Noto Sans JP", sans-serif;
  background: #fff;
  color: #333;
  cursor: pointer;
}

.histories2-filter-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-family: "Noto Sans JP", sans-serif;
  background: #fff;
  flex: 1;
  min-width: 180px;
}

.histories2-filter-input:focus,
.histories2-filter-select:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 2px rgba(33,150,243,0.1);
}

/* ===========================
   5. セッションカード
   =========================== */

.histories2-session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.histories2-session-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}

.histories2-session-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #f0f7ff;
}

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

.histories2-card-risk {
  font-size: 14px;
}

.histories2-card-text {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.histories2-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #999;
}

/* ===========================
   6. 承認ステータスバッジ
   =========================== */

.histories2-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.histories2-badge-approved {
  background: #e8f5e9;
  color: #2e7d32;
}

.histories2-badge-pending {
  background: #fff8e1;
  color: #f57f17;
}

.histories2-badge-rejected {
  background: #fce4ec;
  color: #c62828;
}

/* ===========================
   7. 空状態
   =========================== */

.histories2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #ccc;
  text-align: center;
  gap: 12px;
}

.histories2-empty i {
  font-size: 48px;
}

.histories2-empty p {
  font-size: 14px;
  line-height: 1.6;
}

/* ===========================
   8. ローディング
   =========================== */

.histories2-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  color: #888;
  font-size: 14px;
}

.histories2-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #2196F3;
  border-radius: 50%;
  animation: histories2-spin 0.8s linear infinite;
}

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

/* ===========================
   9. さらに読み込むボタン
   =========================== */

.histories2-load-more-wrap {
  text-align: center;
  padding: 20px 0;
}

.histories2-load-more-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  font-family: "Noto Sans JP", sans-serif;
  transition: background 0.15s;
}

.histories2-load-more-btn:hover {
  background: #f5f5f5;
}

.histories2-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===========================
   10. フッター（index2と共通クラス）
   =========================== */

.histories2-body .index2-footer {
  background: #fff;
  border-top: 1px solid #eee;
  padding: 12px 20px;
  text-align: center;
  font-size: 11px;
  color: #6c757d;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  flex-shrink: 0;
}

.histories2-body .index2-footer a {
  color: #6c757d;
  text-decoration: none;
}

.histories2-body .index2-footer a:hover {
  text-decoration: underline;
}

/* ===========================
   11. レスポンシブ（768px以下）
   =========================== */

@media (max-width: 768px) {
  .histories2-main {
    padding: 16px;
  }

  .histories2-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .histories2-filter-select {
    width: 100%;
  }

  .histories2-filter-input {
    min-width: 0;
  }

  .histories2-body .index2-header-right {
    gap: 4px;
  }

  .histories2-new-check-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}
