/* ベース設定 */
:root {
  /* カラーパレット - ライトモード (Discord風) */
  --primary-color: #5865F2;
  --primary-dark: #4752C4;
  --primary-light: #E8E9FD;
  --primary-gradient: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
  --secondary-color: #2E3267;
  --secondary-light: #E9E4F9;
  --success-color: #3BA55C;
  --success-light: #ECFDF3;
  --warning-color: #FAA61A;
  --warning-light: #FFF5E9;
  --danger-color: #ED4245;
  --danger-light: #FDECEC;
  --info-color: #3E93EC;
  --info-light: #ECF4FD;
  --dark-color: #23272A;
  --text-color: #2E3338;
  --text-secondary: #747F8D;
  --text-light: #96989D;
  --text-muted: #B9BBBE;
  --bg-color: #F2F3F5;
  --bg-light: #FFFFFF;
  --bg-dark: #EBEDEF;
  --sidebar-bg: #FFFFFF;
  --card-bg: #FFFFFF;
  --border-color: #DCDDDE;
  --border-light: #EBEDEF;
  
  /* 効果 */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 16px rgba(88, 101, 242, 0.1);
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* レイアウト */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --header-height: 64px;
  --container-padding: 30px;
  
  /* アニメーション */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  font-size: 14px;
  line-height: 1.5;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}

/* アプリレイアウト */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* サイドバー */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  transition: var(--transition);
  z-index: 1000;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  height: 30px;
  transition: var(--transition);
}

.sidebar.collapsed .logo {
  display: none;
}

.collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--text-light);
  border-radius: 50%;
  transition: var(--transition);
}

.collapse-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.sidebar-nav {
  padding: 20px 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.theme-switch {
  margin-bottom: 16px;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition);
}

.theme-toggle-btn i {
  margin-right: 12px;
}

.theme-toggle-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.sidebar-info {
  font-size: 12px;
  color: var(--text-light);
}

.sidebar-help {
  display: flex;
  align-items: center;
  margin-top: 8px;
  color: var(--primary-color);
}

.sidebar-help i {
  margin-right: 8px;
}

.sidebar-nav ul li {
  position: relative;
  margin-bottom: 8px;
  padding: 0 16px;
}

.sidebar-nav ul li a {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: var(--text-color);
  transition: var(--transition);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.sidebar-nav ul li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.sidebar-nav ul li a i {
  font-size: 20px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-nav ul li a span {
  margin-left: 10px;
  white-space: nowrap;
  opacity: 1;
  transition: var(--transition);
  font-weight: 500;
}

.sidebar.collapsed .sidebar-nav ul li a span {
  opacity: 0;
  width: 0;
}

.sidebar-nav ul li a:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.sidebar-nav ul li.active a {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.sidebar-nav ul li.active a::before {
  width: 4px;
  opacity: 1;
}

.sidebar-nav ul li a .menu-tooltip {
  position: absolute;
  left: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-gradient);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
  z-index: 10;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-nav ul li a:hover .menu-tooltip {
  opacity: 1;
  visibility: visible;
}

/* メインコンテンツ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  margin-left: var(--sidebar-width);
  transition: var(--transition);
}

.sidebar.collapsed + .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* トップヘッダー */
.top-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  z-index: 990;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

.header-left {
  display: flex;
  align-items: center;
}

.mobile-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-color);
  margin-right: 15px;
  transition: var(--transition);
}

.mobile-toggle-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.search-container {
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  border-radius: 20px;
  padding: 8px 15px;
  width: 300px;
}

.search-container i {
  color: var(--text-light);
  margin-right: 8px;
}

.search-input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  color: var(--text-color);
}

.header-actions {
  display: flex;
  align-items: center;
}

.header-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-light);
  margin-left: 5px;
  border-radius: 50%;
  transition: var(--transition);
}

.header-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: var(--danger-color);
  color: white;
  font-size: 10px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-profile {
  display: flex;
  align-items: center;
  margin-left: 15px;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.user-profile:hover {
  background-color: var(--primary-light);
}

.profile-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  margin: 0 10px;
  white-space: nowrap;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  color: var(--text-light);
}

/* ページコンテンツ */
.page-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
}

.page-title h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-title p {
  color: var(--text-light);
  max-width: 600px;
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* ボタンスタイル */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transform: translateZ(0);
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 1;
}

.btn:hover::before {
  transform: translateY(0);
}

.btn span, .btn i {
  position: relative;
  z-index: 2;
}

.primary-btn {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.2);
}

.primary-btn:hover {
  box-shadow: 0 6px 16px rgba(88, 101, 242, 0.3);
  transform: translateY(-2px);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.2);
}

.secondary-btn {
  background-color: white;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.secondary-btn:hover {
  background-color: var(--bg-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.secondary-btn:active {
  transform: translateY(0);
}

.text-btn {
  color: var(--primary-color);
  padding: 6px 12px;
  background: transparent;
}

.text-btn:hover {
  background-color: var(--primary-light);
}

.btn i {
  margin-right: 8px;
  font-size: 16px;
}

.mini-btn {
  padding: 6px 12px;
  font-size: 12px;
}

/* ダッシュボードセクション */
.dashboard-section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.section-header h2 i {
  margin-right: 10px;
  color: var(--primary-color);
}

.section-actions {
  display: flex;
  gap: 8px;
}

/* KPIカード */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.kpi-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 16px;
  flex-shrink: 0;
}

.kpi-card:nth-child(1) .kpi-icon {
  background-color: rgba(88, 101, 242, 0.1);
  color: var(--primary-color);
}

.kpi-card:nth-child(2) .kpi-icon {
  background-color: rgba(59, 165, 92, 0.1);
  color: var(--success-color);
}

.kpi-card:nth-child(3) .kpi-icon {
  background-color: rgba(250, 166, 26, 0.1);
  color: var(--warning-color);
}

.kpi-card:nth-child(4) .kpi-icon {
  background-color: rgba(62, 147, 236, 0.1);
  color: var(--info-color);
}

.kpi-icon i {
  font-size: 24px;
}

.kpi-content {
  flex: 1;
}

.kpi-content h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kpi-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-light);
}

.kpi-chart {
  width: 90px;
  height: 40px;
  margin-left: auto;
}

/* カードコンテナ */
.card-container {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}

/* ダッシュボードカード */
.dashboard-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-light);
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-light);
}

/* バッジ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge.active {
  background-color: var(--success-light);
  color: var(--success-color);
}

.badge.warning {
  background-color: var(--warning-light);
  color: var(--warning-color);
}

.badge.danger {
  background-color: var(--danger-light);
  color: var(--danger-color);
}

/* AIタスクリスト */
.ai-task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-task-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.ai-task-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ai-task-item.running {
  border-left: 3px solid var(--info-color);
}

.ai-task-item.paused {
  border-left: 3px solid var(--warning-color);
  opacity: 0.8;
}

.task-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--info-light);
  color: var(--info-color);
  margin-right: 12px;
  flex-shrink: 0;
}

.ai-task-item.paused .task-icon {
  background-color: var(--warning-light);
  color: var(--warning-color);
}

.no-tasks {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
  list-style: none;
}

.task-info {
  flex: 1;
}

.task-name {
  font-weight: 500;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.paused-label {
  font-size: 11px;
  background-color: var(--warning-light);
  color: var(--warning-color);
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

.task-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background-color: var(--bg-color);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-light);
  min-width: 36px;
  text-align: right;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-left: 10px;
}

.task-actions .text-btn {
  padding: 6px;
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition);
}

.ai-task-item:hover .task-actions .text-btn {
  opacity: 1;
}

/* タブコントロール */
.tab-controls {
  display: flex;
  background-color: var(--bg-color);
  border-radius: var(--radius);
  padding: 3px;
}

.tab-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  transition: var(--transition);
}

.tab-btn.active {
  background-color: var(--card-bg);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 結果リスト */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.result-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.result-item.success {
  border-left: 3px solid var(--success-color);
}

.result-item.failed {
  border-left: 3px solid var(--danger-color);
}

.result-item.pending {
  border-left: 3px solid var(--warning-color);
}

.result-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

.result-item.success .result-icon {
  background-color: var(--success-light);
  color: var(--success-color);
}

.result-item.failed .result-icon {
  background-color: var(--danger-light);
  color: var(--danger-color);
}

.result-item.pending .result-icon {
  background-color: var(--warning-light);
  color: var(--warning-color);
}

.result-info {
  flex: 1;
}

.result-title {
  font-weight: 500;
  margin-bottom: 2px;
}

.result-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.result-meta {
  font-size: 11px;
  color: var(--text-light);
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-left: 10px;
}

/* 目のアイコンボタンスタイルの追加（新規） */
.view-detail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(88, 101, 242, 0.1);
  color: var(--primary-color);
  transition: var(--transition);
}

.view-detail-btn:hover {
  background-color: rgba(88, 101, 242, 0.2);
  transform: translateY(-2px);
}

.view-detail-btn i {
  font-size: 18px;
}

.result-actions .text-btn {
  padding: 6px;
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition);
}

.result-item:hover .result-actions .text-btn {
  opacity: 1;
}

/* 設定グループ */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-info {
  flex: 1;
}

.setting-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.setting-info p, .setting-info h5 {
  font-size: 12px;
  color: var(--text-light);
  font-weight: normal;
}

.setting-control {
  min-width: 180px;
  display: flex;
  justify-content: flex-end;
}

.sub-setting {
  padding-left: 20px;
  border-left: 2px solid var(--border-light);
  margin-left: 10px;
}

.setting-divider {
  height: 1px;
  background-color: var(--border-light);
  margin: 8px 0;
}

.setting-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--bg-light);
  color: var(--text-color);
  outline: none;
  transition: var(--transition);
}

.setting-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.1);
}

/* トグルスイッチ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: var(--transition);
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: var(--transition);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* カードアクション */
.edit-conditions-btn, .train-ai-btn {
  font-size: 13px;
}

/* レーティング */
.rating-summary {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: right;
}

.rating-stars {
  color: var(--warning-color);
  font-size: 16px;
  margin-bottom: 5px;
}

.rating-value {
  font-weight: 600;
  font-size: 14px;
}

/* フィードバックタイプ */
.feedback-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.feedback-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feedback-label {
  width: 100px;
  font-size: 13px;
  color: var(--text-secondary);
}

.feedback-progress .progress-bar {
  flex: 1;
}

.feedback-progress .progress-text {
  min-width: 30px;
  text-align: right;
  font-weight: 600;
  color: var(--text-color);
}

/* タグ */
.keyword-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.tag-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag.good {
  background-color: var(--success-light);
  color: var(--success-color);
}

.tag.bad {
  background-color: var(--danger-light);
  color: var(--danger-color);
}

.add-tag-btn {
  align-self: flex-start;
  font-size: 12px;
  margin-top: 5px;
}

/* 学習ソース */
.learning-sources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.source-item {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-label input {
  margin-right: 8px;
}

/* 最終学習情報 */
.last-training {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.training-date {
  font-weight: 500;
}

.training-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.training-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
}

.training-status.success {
  background-color: var(--success-light);
  color: var(--success-color);
}

.training-improvement {
  font-size: 12px;
  color: var(--success-color);
  font-weight: 500;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  width: 500px;
  max-width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  animation: modalFadeIn 0.3s;
}

/* すべての結果表示モーダル用のスタイル */
.all-results-modal-content {
  width: 800px;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.all-results-tabs {
  margin-bottom: 20px;
}

/* 詳細表示モーダル用のスタイル（更新版） */
.detail-modal-content {
  width: 700px;
  max-width: 90%;
  max-height: 80vh; /* ビューポートの80%の高さに制限 */
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* モーダル全体を縦方向にスクロール可能に */
  position: relative;
}

.detail-header {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--primary-light);
  position: sticky; /* ヘッダーを固定 */
  top: 0; /* 上部に固定 */
  z-index: 10; /* 他の要素より前面に */
}

.detail-header .result-icon {
  margin-right: 15px;
}

.detail-header .detail-title {
  flex: 1;
}

.detail-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
}

.detail-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.detail-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  box-sizing: border-box; /* パディングを含む全体サイズの計算方法を指定 */
}

/* 最後のセクションの下線を消す */
.detail-section:last-child {
  border-bottom: none;
}

/* 企業リストを含むセクションの特別な設定 */
.detail-section:nth-child(4) {
  display: flex;
  flex-direction: column;
  min-height: 200px; /* 最小高さを確保するが、コンテンツが少ない場合にもフッターが下部に表示されるよう調整 */
  flex: 1; /* フレックスコンテナ内で拡大して余白を埋める */
  border-bottom: none; /* 下部の境界線を削除 */
}

.detail-info-row {
  display: flex;
  margin-bottom: 12px;
}

.detail-info-label {
  width: 120px;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-info-value {
  flex: 1;
}

/* 企業リストヘッダー部分 */
.company-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.company-list-header h3 {
  margin-bottom: 0;
}

.list-count {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 企業リスト部分 */
.company-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding-right: 5px;
  overflow-y: visible;
  padding-bottom: 20px; /* 通常のパディングに戻す */
  flex: 1; /* 利用可能なスペースを埋める */
  border: none; /* 境界線を削除 */
}

/* 長い企業名の適切な折り返し処理 */
.company-item {
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 13px;
  word-break: break-word; /* 長い単語を折り返す */
  overflow-wrap: break-word; /* 長いテキストを折り返す */
  margin-bottom: 0; /* 余分なマージンを削除 */
}

/* スクロールバーのカスタマイズ */
.company-list::-webkit-scrollbar,
.detail-modal-content::-webkit-scrollbar {
  width: 8px;
}

.company-list::-webkit-scrollbar-track,
.detail-modal-content::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

.company-list::-webkit-scrollbar-thumb,
.detail-modal-content::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

.company-list::-webkit-scrollbar-thumb:hover,
.detail-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* フッター修正 - 最後でのみ固定表示 */
.detail-footer {
  display: flex;
  justify-content: flex-end;
  padding: 15px 20px;
  border-top: 1px solid var(--border-light);
  background-color: var(--card-bg);
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  margin-top: auto; /* モーダルの最後に表示 */
}

.detail-actions {
  display: flex;
  gap: 10px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-modal {
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  gap: 10px;
}

/* フォーム要素 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--bg-light);
  color: var(--text-color);
  outline: none;
  transition: var(--transition);
}

.range-slider {
  display: flex;
  align-items: center;
  gap: 15px;
}

.range-slider input[type="range"] {
  flex: 1;
  height: 8px;
  background-color: var(--bg-color);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-gradient);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.range-value {
  min-width: 60px;
  font-weight: 500;
  color: var(--text-color);
}

/* トースト通知 */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 300px;
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  animation: toastFadeIn 0.3s;
  transform: translateX(0);
  transition: transform 0.3s, opacity 0.3s;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  background-color: var(--success-color);
  color: white;
}

.toast.error {
  background-color: var(--danger-color);
  color: white;
}

.toast.info {
  background-color: var(--primary-color);
  color: white;
}

.toast.warning {
  background-color: var(--warning-color);
  color: white;
}

.toast-content {
  flex: 1;
  margin: 0 10px;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 13px;
  opacity: 0.9;
}

.toast-icon {
  font-size: 22px;
}

.toast-close {
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
}

.toast-close:hover {
  opacity: 1;
}

/* モバイルメニューオーバーレイ */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ダークモード */
body.theme-dark {
  /* Discord風ダークテーマ */
  --primary-color: #7289DA;
  --primary-dark: #5F73BC;
  --primary-light: #414980;
  --primary-gradient: linear-gradient(135deg, #7289DA 0%, #5F73BC 100%);
  
  --text-color: #FFFFFF;
  --text-secondary: #B9BBBE;
  --text-light: #8E9297;
  --text-muted: #72767D;
  
  --bg-color: #36393F;
  --bg-light: #40444B;
  --bg-dark: #2F3136;
  
  --sidebar-bg: #2F3136;
  --card-bg: #40444B;
  
  --border-color: #202225;
  --border-light: #4F545C;
  
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 16px rgba(114, 137, 218, 0.2);
}

/* ダークモード時のヘッダーと入力改善 */
body.theme-dark .top-header {
  background-color: #202225 !important; /* Discord の暗めのバックグラウンド */
  border-bottom-color: #4F545C !important;
  backdrop-filter: none !important;
}

body.theme-dark .search-container {
  background-color: #202225;
}

body.theme-dark .search-input {
  color: #FFFFFF;
}

body.theme-dark .sidebar-nav ul li.active a {
  background-color: #42464D; /* Discord アクティブ項目 */
}

body.theme-dark .sidebar-nav ul li a:hover {
  background-color: #42464D;
}

/* レスポンシブ */
@media (max-width: 1200px) {
  .two-columns {
    grid-template-columns: 1fr;
  }
  
  .kpi-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 15px;
  }
  
  .page-content {
    padding: 20px;
  }
  
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .sidebar.collapsed + .main-content {
    margin-left: 0;
  }
  
  .top-header {
    padding: 0 15px;
  }
  
  .search-container {
    width: 200px;
  }
  
  .page-header {
    flex-direction: column;
  }
  
  .page-actions {
    margin-top: 15px;
    width: 100%;
  }
  
  .mobile-menu-overlay {
    display: block;
  }
  
  .mobile-toggle-btn {
    display: flex;
    margin-right: 15px;
  }
  
  .kpi-cards {
    grid-template-columns: 1fr;
  }
  
  /* モバイル向け詳細モーダル調整 */
  .company-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
  
  .detail-modal-content {
    max-height: 90vh;
  }
}

@media (max-width: 576px) {
  .user-info {
    display: none;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .card-header h3 {
    margin-bottom: 10px;
  }
  
  .tab-controls {
    width: 100%;
    margin-top: 10px;
  }
  
  .tab-btn {
    flex: 1;
    text-align: center;
  }
  
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .setting-control {
    width: 100%;
    margin-top: 10px;
  }
  
  /* 極小画面での詳細モーダル調整 */
  .company-list {
    grid-template-columns: 1fr; /* 1列にする */
  }
  
  .detail-info-row {
    flex-direction: column;
  }
  
  .detail-info-label {
    width: 100%;
    margin-bottom: 4px;
  }
  
  .company-list-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .list-count {
    margin-top: 5px;
  }
}

/* Disabled toggle switch styles */
.toggle-switch.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toggle-switch.disabled input {
  cursor: not-allowed;
}

.toggle-switch.disabled .toggle-slider {
  cursor: not-allowed;
}

/* Coming Soon card styles */
.coming-soon-card {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coming-soon-card .card-body {
  text-align: center;
  padding: 60px 40px;
}

/* Notice badge styles */
.notice-badge {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  background: #f0f9ff;
  color: #0369a1;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.notice-badge i {
  margin-right: 4px;
}

/* =========================================================
   Profile Dropdown Styles
   ========================================================= */
.user-profile {
  position: relative;
  margin-left: 15px;
}

.profile-trigger {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.profile-trigger:hover {
  background-color: var(--primary-light);
}

.profile-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  margin: 0 10px;
  white-space: nowrap;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  color: var(--text-light);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 1000;
  overflow: hidden;
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
}

.user-profile.active .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  align-items: center;
  padding: 16px;
  background-color: var(--primary-light);
  border-bottom: 1px solid var(--border-color);
}

.dropdown-profile-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  border: 2px solid white;
}

.dropdown-user-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--primary-color);
}

.dropdown-user-email {
  font-size: 12px;
  color: var(--text-secondary);
}

.dropdown-body {
  padding: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--text-color);
  transition: var(--transition);
  text-decoration: none;
}

.dropdown-item:hover {
  background-color: var(--bg-color);
}

.dropdown-item i {
  width: 24px;
  font-size: 16px;
  color: var(--text-light);
  margin-right: 10px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 8px 0;
}

.logout-item {
  color: var(--danger-color);
}

.logout-item i {
  color: var(--danger-color);
}

/* Dark mode styles for dropdown */
body.theme-dark .dropdown-header {
  background-color: var(--primary-dark);
}

body.theme-dark .dropdown-user-name {
  color: white;
}

body.theme-dark .dropdown-user-email {
  color: var(--text-light);
}