/* trender.css - Rakuten-Trender 管理画面スタイル */
/* 2025-12-09 v3.13対応 - 商品レポート共通UI化・不要クラス削除 */
/* トラッカーデザイン踏襲、ヘッダーは淡い赤系 */

/* ===== リセット・基本 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #24292e;
  background: #f5f7fa;
  line-height: 1.5;
}

/* ===== アプリコンテナ ===== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== ヘッダー（淡い赤系） ===== */
.app-header {
  background: #2d3748;
  color: #ffffff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-left h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 2px 0;
}

.last-updated {
  font-size: 12px;
  opacity: 0.9;
  margin: 0;
}

.header-right .btn-outline {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255,255,255,0.5);
}

.header-right .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #ffffff;
}

/* ===== メインレイアウト ===== */
.app-main {
  display: flex;
  flex: 1;
}

/* ===== サイドバー ===== */
.sidebar {
  width: 180px;
  background: #ffffff;
  border-right: 1px solid #e1e4e8;
  padding: 12px 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #5f6368;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.nav-item:hover {
  background: #f8f9fa;
  color: #e57373;
}

.nav-item.active {
  background: #f5f7fa;
  color: #e57373;
  border-left-color: #e57373;
  font-weight: 600;
}

.nav-icon {
  font-size: 14px;
  margin-right: 8px;
  width: 20px;
  text-align: center;
}

.nav-label {
  font-size: 14px;
}

/* ===== コンテンツエリア ===== */
.content-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* ===== セクションヘッダー ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #24292e;
  margin: 0;
}

/* ===== カード ===== */
.card {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e1e4e8;
}

.card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #24292e;
  margin: 0 0 12px 0;
}

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

.card-header h3 {
  margin: 0;
}

/* ===== ボタン ===== */
.btn {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-primary {
  background: #0366d6;
  color: #ffffff;
  border-color: #0366d6;
}

.btn-primary:hover {
  background: #0256b9;
  border-color: #0256b9;
}

.btn-outline {
  background: #ffffff;
  color: #24292e;
  border-color: #d1d5da;
}

.btn-outline:hover {
  background: #f3f4f6;
  border-color: #e57373;
}

.btn-danger {
  background: #d73a49;
  color: #ffffff;
  border-color: #d73a49;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== フォームコントロール ===== */
.form-control {
  width: 100%;
  padding: 5px 10px;
  font-size: 14px;
  border: 1px solid #d1d5da;
  border-radius: 4px;
  background: #ffffff;
  color: #24292e;
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: #0366d6;
  box-shadow: 0 0 0 2px rgba(3,102,214,0.1);
}

/* ===== フォームグループ ===== */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #24292e;
  margin-bottom: 4px;
}

.form-hint {
  font-size: 12px;
  color: #586069;
  margin-top: 4px;
}

/* ===== ステータスグリッド（全体状況） ===== */
.status-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.status-item {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
}

.status-label {
  display: block;
  font-size: 12px;
  color: #586069;
  margin-bottom: 2px;
}

.status-value {
  font-size: 16px;
  font-weight: 600;
  color: #24292e;
}

.status-value.status-completed {
  color: #28a745;
}

.status-value.status-error {
  color: #d73a49;
}

.status-value.status-running {
  color: #0366d6;
}

.status-sub {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e1e4e8;
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-sub .status-label {
  margin-bottom: 0;
}

.status-sub .status-value {
  font-size: 13px;
}

/* ===== ジャンルグリッド ===== */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.genre-card {
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
}

.genre-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #24292e;
}

.genre-info {
  font-size: 12px;
  color: #586069;
  margin-bottom: 8px;
}

.genre-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.genre-status-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

.genre-status-badge.completed {
  background: #dcffe4;
  color: #22863a;
}

.genre-status-badge.running {
  background: #dbedff;
  color: #0366d6;
}

.genre-status-badge.error {
  background: #ffeef0;
  color: #d73a49;
}

/* ===== アラートサマリー ===== */
.alert-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.alert-column h4 {
  font-size: 12px;
  font-weight: 600;
  color: #586069;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e1e4e8;
}

.alert-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.alert-row span:first-child {
  color: #586069;
}

.alert-row span:last-child {
  font-weight: 600;
  color: #24292e;
}

/* ===== アラート通知バー ===== */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 12px;
}

.alert-warning {
  background: #fff8e1;
  color: #f57c00;
  border: 1px solid #ffcc80;
}

.alert-info {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.alert-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ===== テーブル ===== */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e1e4e8;
}

.data-table th {
  background: #f6f8fa;
  font-weight: 600;
  color: #24292e;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.no-data {
  text-align: center;
  color: #586069;
  padding: 24px;
  font-size: 12px;
}

.loading {
  text-align: center;
  color: #0366d6;
  padding: 24px;
  font-size: 12px;
}

/* ===== テーブルカラム幅 ===== */
.col-check {
  width: 40px;
  text-align: center;
}

.col-row {
  width: 50px;
}

.col-action {
  width: 80px;
  text-align: center;
}

/* ===== タブ ===== */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e1e4e8;
  padding-bottom: 0;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #586069;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: #24292e;
}

.tab-btn.active {
  color: #e57373;
  border-bottom-color: #e57373;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== フィルター行 ===== */
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 500;
  color: #586069;
}

/* ===== キーワードツールバー ===== */
.keyword-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.keyword-count {
  font-size: 12px;
  color: #586069;
  font-weight: 500;
}

/* ===== モーダル ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  border-radius: 8px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content.modal-lg {
  max-width: 640px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e1e4e8;
}

.modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #586069;
  line-height: 1;
}

.modal-close:hover {
  color: #24292e;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e1e4e8;
}

/* ===== CSVプレビュー ===== */
.csv-preview {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 8px;
}

.csv-preview table {
  width: 100%;
  border-collapse: collapse;
}

.csv-preview th,
.csv-preview td {
  padding: 4px 8px;
  border: 1px solid #e1e4e8;
  text-align: left;
}

.csv-preview th {
  background: #f0f0f0;
}

/* ===== レポートメニュー ===== */
.report-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.report-group h4 {
  font-size: 12px;
  font-weight: 600;
  color: #24292e;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e1e4e8;
}

.report-link {
  display: block;
  padding: 4px 0;
  font-size: 12px;
  color: #0366d6;
  text-decoration: none;
}

.report-link:hover {
  text-decoration: underline;
}

/* ===== 実行制御 ===== */
.execution-status {
  margin-bottom: 16px;
}

.status-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.status-row:last-child {
  border-bottom: none;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.idle {
  background: #f0f0f0;
  color: #586069;
}

.status-badge.running {
  background: #dbedff;
  color: #0366d6;
}

.status-badge.completed {
  background: #dcffe4;
  color: #22863a;
}

.status-badge.error {
  background: #ffeef0;
  color: #d73a49;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 設定グリッド ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.settings-group h4 {
  font-size: 12px;
  font-weight: 600;
  color: #24292e;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e1e4e8;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.settings-row span:first-child {
  color: #586069;
}

.settings-row span:last-child {
  font-weight: 500;
  color: #24292e;
}

/* ===== マーカー色 ===== */
.marker-own {
  background-color: #c8e6c9;
}

.marker-competitor {
  background-color: #ffcdd2;
}

.marker-watch {
  background-color: #fff9c4;
}

/* ===== ランキング入賞バッジ ===== */
.ranking-crown {
  margin-right: 4px;
  font-size: 14px;
}
.marker-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.marker-badge.marker-own {
  background-color: #c8e6c9;
  color: #2e7d32;
}

.marker-badge.marker-competitor {
  background-color: #ffcdd2;
  color: #c62828;
}

.marker-badge.marker-watch {
  background-color: #fff9c4;
  color: #f57f17;
}

/* ===== 楽天リンク共通スタイル ===== */
.rakuten-link {
  color: #bf360c;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.rakuten-link:hover {
  color: #e64a19;
  text-decoration: underline;
}

/* =====================================================
   ===== レポート共通スタイル【共通パーツ】 =====
   ===== ジャンル・カテゴリ・キーワード・商品共通 =====
   ===================================================== */

/* ===== レポートセクション ===== */
.report-section {
  margin-bottom: 24px;
}

.report-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1e4e8;
}

.report-section-content {
  min-height: 60px;
}

/* ===== レポートヘッダー（グレー帯）【共通パーツ】 ===== */
.report-header {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.header-info {
  font-size: 13px;
  color: #24292e;
  font-weight: 500;
}

/* ===== 情報ヘッダー（ジャンル・カテゴリ・キーワード共通） ===== */
.category-info-header,
.keyword-info-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}

.cat-info-item,
.kw-info-item {
  white-space: nowrap;
}

.cat-info-item strong,
.kw-info-item strong {
  color: #586069;
  font-weight: 500;
}

/* 帯内リンク共通スタイル（赤色統一） */
.cat-info-item a,
.cat-info-item [onclick],
.kw-info-item a,
.kw-info-item [onclick] {
  color: #c62828;
  cursor: pointer;
  font-weight: 600;
}

.cat-info-item a:hover,
.cat-info-item [onclick]:hover,
.kw-info-item a:hover,
.kw-info-item [onclick]:hover {
  text-decoration: underline;
}

/* ===== レポートカード（R11/R13共通）【共通パーツ】 ===== */
.report-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.report-card {
  flex: 0 0 auto;
  min-width: 130px;
  max-width: 160px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  text-align: center;
}

.report-card:hover {
  border-color: #e57373;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-label {
  font-size: 12px;
  color: #586069;
  margin-bottom: 4px;
}

.card-value {
  font-size: 20px;
  font-weight: 600;
  color: #24292e;
  line-height: 1.2;
}

.card-diff {
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

.card-sub {
  font-size: 12px;
  color: #586069;
  margin-top: 4px;
}

/* ===== 前日比色【共通パーツ】 ===== */
.diff-positive {
  color: #0366d6;
}

.diff-negative {
  color: #d73a49;
}

.diff-neutral {
  color: #28a745;
}

/* ===== 順位変動【共通パーツ】 ===== */
.rank-up {
  color: #0366d6;
  font-size: 12px;
  margin-left: 4px;
}

.rank-down {
  color: #d73a49;
  font-size: 12px;
  margin-left: 4px;
}

.rank-new {
  color: #28a745;
  font-size: 10px;
  font-weight: 600;
  background: #dcffe4;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

/* ===== 店舗占有TOP5カード（R6共通）【共通パーツ】 ===== */
.shop-ranking-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.shop-ranking-card {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-align: center;
}

.shop-ranking-card:hover {
  border: 1px solid #e57373;
}

.shop-rank-label {
  font-size: 12px;
  color: #586069;
}

.shop-code-link {
  font-size: 14px;
  font-weight: 600;
  color: #c62828;
  cursor: pointer;
}

.shop-code-link:hover {
  text-decoration: underline;
}

.shop-name-link {
  color: #c62828;
  cursor: pointer;
  font-size: 13px;
}

.shop-name-link:hover {
  text-decoration: underline;
}

/* RA3店舗占有ランキング - 2段表示 */
.shop-name-primary {
  font-weight: 600;
  color: #24292e;
  font-size: 13px;
  line-height: 1.3;
}

.shop-code-secondary {
  font-size: 12px;
  color: #586069;
  line-height: 1.3;
}

.shop-code-only {
  font-weight: 600;
  color: #24292e;
  font-size: 13px;
}

.shop-card-header {
  font-size: 12px;
  color: #586069;
  margin-top: 8px;
}

.shop-card-rate {
  font-size: 13px;
  font-weight: 600;
  color: #24292e;
}

.shop-card-sub {
  font-size: 12px;
  color: #586069;
  margin-top: 4px;
}

.shop-card-count {
  font-size: 12px;
  color: #586069;
}

/* ===== キーワード一覧テーブル ===== */
.keyword-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.keyword-list-table th,
.keyword-list-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e1e4e8;
}

.keyword-list-table th {
  background: #f6f8fa;
  font-weight: 600;
  color: #24292e;
  white-space: nowrap;
}

.keyword-list-table tbody tr {
  transition: background 0.15s;
}

.keyword-list-table tbody tr:hover {
  background: #f8f9fa;
}

.keyword-link {
  color: #0366d6;
  font-weight: 500;
}

.keyword-link:hover {
  text-decoration: underline;
}

/* ===== R12: 新規参入ピックアップ ===== */
.pickup-section {
  margin-top: 16px;
}

.pickup-title {
  font-size: 12px;
  font-weight: 600;
  color: #24292e;
  margin-bottom: 8px;
}

.pickup-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pickup-card {
  padding: 8px 12px;
  background: #e8f5e9;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
}

.pickup-rank {
  font-weight: 600;
  color: #28a745;
}

.pickup-item {
  color: #24292e;
  margin-top: 2px;
}

.pickup-card-link {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pickup-card-link:hover {
  border-color: #e57373;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ===== R10: TOP45テーブル ===== */
.top45-table .item-shop {
  font-weight: 600;
  color: #24292e;
}

.top45-table .item-code {
  font-size: 12px;
  color: #586069;
}

.top45-table .item-price {
  font-weight: 600;
  color: #24292e;
}

.top45-table .item-effective-price {
  font-size: 12px;
  color: #bf0000;
}

.top45-table .item-nei {
  font-weight: 600;
  color: #24292e;
}

.top45-table .item-coupon-point {
  font-size: 12px;
  color: #0366d6;
}

.top45-table .item-review-rating {
  font-weight: 600;
  color: #f5a623;
}

.top45-table .item-review-count {
  font-size: 12px;
  color: #586069;
}

.top45-table .badge-cell {
  white-space: nowrap;
}

.top45-table .badge-cell svg {
  vertical-align: middle;
  margin-right: 2px;
}

/* ===== チャートコンテナ ===== */
.chart-container {
  position: relative;
  width: 100%;
}

/* ===== レポートセレクター ===== */
.report-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
}

.filter-action {
  display: flex;
  align-items: flex-end;
  margin-left: 0;
}

/* ===== レポート説明 ===== */
.report-description {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 12px;
  color: #586069;
}

.report-description p {
  margin: 0 0 8px 0;
}

.report-contents {
  margin: 0;
  padding-left: 20px;
}

.report-contents li {
  margin: 4px 0;
}

/* ===== レポートプレースホルダー ===== */
.report-placeholder {
  padding: 40px;
  text-align: center;
}

/* ===== 操作ログテーブル ===== */
.operation-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.operation-log-table th,
.operation-log-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e1e4e8;
}

.operation-log-table th {
  background: #f6f8fa;
  font-weight: 600;
}

/* ===== アカウントステータス ===== */
.account-status-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.account-status-item {
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
}

.account-status-item.valid {
  background: #dcffe4;
  color: #22863a;
}

.account-status-item.invalid {
  background: #ffeef0;
  color: #d73a49;
}

.account-status-item.unknown {
  background: #f0f0f0;
  color: #586069;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .app-main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e1e4e8;
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 8px;
  }

  .nav-item {
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 12px;
    white-space: nowrap;
  }

  .nav-item.active {
    border-left: none;
    border-bottom-color: #e57373;
  }

  .content-area {
    padding: 12px;
  }

  .status-grid {
    flex-direction: column;
  }

  .alert-summary {
    grid-template-columns: 1fr;
  }

  .genre-grid {
    grid-template-columns: 1fr;
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .keyword-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-right {
    flex-wrap: wrap;
  }

  .report-cards {
    justify-content: center;
  }

  .report-card {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
    max-width: none;
  }

  .shop-ranking-cards {
    justify-content: center;
  }

  .shop-ranking-card {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
  }

  .category-info-header,
  .keyword-info-header {
    flex-direction: column;
    gap: 8px;
  }

  .report-selectors {
    flex-direction: column;
  }

  .account-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Tierバッジ（水色系）v3.9追加 ===== */

.tier-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}

.tier-badge.tier-1 {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.tier-badge.tier-2 {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.tier-badge.tier-3 {
  background: #f5f5f5;
  color: #616161;
  border: 1px solid #bdbdbd;
}

/* ===== P6: 属性変化バッジ ===== */
.attr-change-badge {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  background: #e3f2fd;
  border-radius: 4px;
  font-size: 12px;
  color: #1565c0;
}

/* ===== P7: アラート種別バッジ ===== */
.alert-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

.alert-type-badge.alert-positive {
  background: #c8e6c9;
  color: #2e7d32;
}

.alert-type-badge.alert-negative {
  background: #ffcdd2;
  color: #c62828;
}

.alert-type-badge.alert-warning {
  background: #fff3e0;
  color: #e65100;
}

/* ===== サマリーレポート（R23-R25）v3.10追加 ===== */

.summary-overview, .watch-overview {
  margin-bottom: 24px;
}

.summary-overview h4, .trend-comparison h4, .trend-section h4, .watch-overview h4, .watch-section h4, .summary-section h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #24292e;
}

.overview-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  border-left: 3px solid #e1e4e8;
}

.stat-card.positive { border-left-color: #28a745; }
.stat-card.negative { border-left-color: #d73a49; }
.stat-card.warning { border-left-color: #f0ad4e; }

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: #24292e;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: #586069;
  margin-top: 4px;
}

.summary-section, .trend-section, .watch-section {
  margin-bottom: 24px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.comparison-item {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.comparison-label {
  display: block;
  font-size: 11px;
  color: #586069;
  margin-bottom: 6px;
}

.comparison-values {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.this-week { font-weight: 600; color: #24292e; }
.vs { color: #586069; font-size: 11px; }
.last-week { color: #586069; }
.change { font-size: 12px; font-weight: 500; }
.change.positive { color: #28a745; }
.change.negative { color: #d73a49; }

.highlight-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.highlight-card {
  padding: 12px 16px;
  background: #fff3e0;
  border-radius: 6px;
  border-left: 3px solid #f0ad4e;
}

.highlight-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #24292e;
}

.highlight-reason {
  display: block;
  font-size: 11px;
  color: #586069;
  margin-top: 4px;
}

/* ===== モーダル共通（watchlist.js移行）v3.10追加 ===== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.release-candidate-row {
  background: #fff8e1;
}

/* ===== テーブルフッター（alerts.js移行）v3.10追加 ===== */

.table-footer {
  padding: 12px 0;
  font-size: 12px;
  color: #586069;
  text-align: right;
}

.result-count {
  font-weight: 500;
}

/* ===== アラートバッジ（dashboard.js移行）v3.10追加 ===== */

.alert-type-badge.alert-up {
  background: #dcffe4;
  color: #22863a;
}

.alert-type-badge.alert-down {
  background: #ffeef0;
  color: #d73a49;
}

/* ===== ジャンルグラフエリア ===== */
.genre-charts-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.genre-chart-box {
  flex: 1;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
}

.genre-chart-title {
  font-size: 0.85em;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin-bottom: 8px;
}

.genre-chart-wrap {
  position: relative;
  height: 220px;
}

.genre-chart-wrap canvas {
  max-height: 100%;
}

@media (max-width: 900px) {
  .genre-charts-row {
    flex-direction: column;
  }
  .genre-chart-wrap {
    height: 200px;
  }
}

/* ===== R9フィルタボタン（赤系） ===== */
.r9-filter-btn {
  background: #fff;
  border: 1px solid #e57373;
  color: #e57373;
  margin-right: 4px;
}

.r9-filter-btn:hover {
  background: #ffebee;
}

.r9-btn-active {
  background: #e57373 !important;
  border-color: #e57373 !important;
  color: #fff !important;
}

/* ============================================================
   ピックアップ商品（ランキング入賞）用CSS
   trender.css に追記
   ============================================================ */

/* ピックアップ商品カード群 */
.ranking-pickup-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ピックアップ商品カード */
.ranking-pickup-card {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 12px 16px;
  min-width: 140px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ranking-pickup-card:hover {
  border-color: #c62828;
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.15);
}

/* 1行目: ランキング👑 */
.ranking-pickup-line1 {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
  margin-bottom: 4px;
}

/* 2行目: 商品コード */
.ranking-pickup-line2 {
  font-size: 13px;
  color: #24292e;
  margin-bottom: 4px;
  word-break: break-all;
}

/* 3行目: 過去3日間 */
.ranking-pickup-line3 {
  font-size: 12px;
  color: #6a737d;
}

/* ============================================================
   product.js用CSS追加（trender.cssに追記）
   ============================================================ */

/* 店舗リンク（商品レポートから店舗レポートへ） */
.shop-link {
  color: #0366d6;
  cursor: pointer;
  text-decoration: none;
}

.shop-link:hover {
  color: #c62828;
  text-decoration: underline;
}

/* キーワードリンク（指カーソル） */
.keyword-link {
  color: #0366d6;
  cursor: pointer;
}

.keyword-link:hover {
  color: #c62828;
  text-decoration: underline;
}

/* R13属性チェックバッジ（落ち着いた赤） */
.attr-check-badge {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: #ffebee;
  border: 1px solid #b71c1c;
  border-radius: 3px;
  color: #b71c1c;
  font-size: 11px;
  font-weight: bold;
}

/* レポート帯のリンクテキスト */
.report-link-text {
  color: #0366d6;
  cursor: pointer;
}

.report-link-text:hover {
  color: #c62828;
  text-decoration: underline;
}

/* ========================================
   ウォッチリスト
   ======================================== */

/* モーダル */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e1e4e8;
}

.modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #586069;
}

.modal-body {
  padding: 16px;
}

.modal-body .form-group {
  margin-bottom: 12px;
}

.modal-body label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #24292e;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e1e4e8;
}

/* ウォッチリスト固有 */
.release-candidate-row {
  background: #fff8e1;
}

.action-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.action-cell .btn {
  white-space: nowrap;
}

.cat-info-link { margin-left: auto; }

/* ========================================
   ページネーション（追加CSS）
   trender.cssの末尾に追加
   ======================================== */

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  margin-top: 0;
}

.pagination-container .page-info {
  font-size: 14px;
  color: var(--text-muted, #666);
  min-width: 80px;
  text-align: center;
}

.pagination-container .btn {
  min-width: 80px;
}

.pagination-container .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== レポートメニュー（ウォッチリストUI統一） ===== */
.report-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  justify-content: flex-start;
}

.report-group {
  min-width: 120px;
}

.report-group h4 {
  font-size: 13px;
  font-weight: 500;
  color: #586069;
  margin: 0 0 8px 0;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  display: inline-block;
}

.report-menu-link {
  color: #e57373;
  text-decoration: none;
  border-bottom: 2px solid #e57373;
  padding-bottom: 6px;
  display: inline-block;
}

.report-menu-link:hover {
  color: #c62828;
  text-decoration: none;
}

.report-item {
  font-size: 12px;
  color: #586069;
  margin: 0;
  padding: 4px 0;
  line-height: 1.5;
}

.report-link {
  display: block;
  padding: 4px 0;
  font-size: 12px;
  color: #0366d6;
  text-decoration: none;
}

.report-link:hover {
  color: #e57373;
  text-decoration: none;
}

/* レビュー評価共通スタイル（RA4等で使用） */
.data-table .item-review-rating {
  color: #F5A623;
  font-weight: bold;
}

.data-table .item-review-count {
  color: #666;
  font-size: 0.9em;
}

/* ランキング分析リンク */
.ranking-link {
  color: #c62828;
  cursor: pointer;
  font-weight: 600;
}
.ranking-link:hover {
  text-decoration: underline;
}

/* ランキング→キーワード選択ミニセレクト */
.keyword-select-mini {
  padding: 2px 6px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
}
.keyword-select-mini:hover {
  border-color: #c62828;
}

/* ===== クロス分析 ===== */
.cross-attribute-section {
  margin-bottom: 24px;
}

.cross-attribute-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

/* Row1: TOP5カード */
.cross-cards-row1 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

/* Row2: 属するカテゴリカード */
.cross-cards-row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.cross-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cross-card {
  min-width: 140px;
  max-width: 180px;
  flex: 1;
  cursor: pointer;
}

/* 属するカテゴリカード */
.cross-card-parent {
  background-color: #f8f9fa;
  border: 1px solid #e1e4e8;
}

/* 属するカテゴリカード - hover時赤枠（C9と統一） */
.cross-card-parent:hover {
  border-color: #c62828;
  box-shadow: 0 2px 4px rgba(198, 40, 40, 0.1);
}

.cross-category-name {
  font-size: 13px;
  font-weight: 600;
  color: #c62828;
  margin-bottom: 8px;
  cursor: pointer;
}

.cross-category-name:hover {
  text-decoration: underline;
}

/* ===== ポジション分析（PA）===== */
.pa-header {
  margin-bottom: 24px;
}

.pa-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.pa-meta-item {
  display: flex;
  flex-direction: column;
}

.pa-meta-label {
  font-size: 11px;
  color: #666;
}

.pa-meta-value {
  font-size: 14px;
  font-weight: 600;
}

.pa-summary-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.pa-summary-card {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 150px;
}

.pa-summary-card.pa-king {
  background: #fff9c4;
  border: 1px solid #fbc02d;
}

.pa-card-label {
  font-size: 11px;
  color: #666;
}

.pa-card-value {
  font-size: 20px;
  font-weight: 700;
}

.pa-card-sub {
  font-size: 11px;
  color: #888;
}

/* 4象限マトリクス */
.pa-quadrant-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.pa-quadrant-matrix {
  display: flex;
  flex-direction: column;
  border: 2px solid #333;
  border-radius: 8px;
  overflow: hidden;
  min-width: 500px;
}

.pa-quadrant-row {
  display: flex;
}

.pa-quadrant-cell {
  flex: 1;
  padding: 16px;
  min-height: 150px;
  border: 1px solid #ddd;
}

.pa-king-zone {
  background: #e8f5e9;
}

.pa-conversion-zone {
  background: #fff3e0;
}

.pa-exposure-zone {
  background: #e3f2fd;
}

.pa-lowpriority-zone {
  background: #f5f5f5;
}

.pa-quadrant-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pa-quadrant-icon {
  font-size: 18px;
}

.pa-quadrant-name {
  font-weight: 700;
  font-size: 14px;
}

.pa-quadrant-count {
  font-size: 12px;
  color: #666;
  margin-left: auto;
}

.pa-quadrant-desc {
  font-size: 11px;
  color: #666;
  margin-bottom: 8px;
}

.pa-quadrant-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pa-item-mini {
  font-size: 11px;
  color: #1976d2;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-item-mini:hover {
  text-decoration: underline;
}

.pa-quadrant-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: #666;
}

.pa-legend-axis {
  display: flex;
  justify-content: space-between;
  width: 150px;
}

.pa-changes {
  margin-top: 16px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
}

.pa-changes h4 {
  font-size: 13px;
  margin-bottom: 8px;
}

.pa-changes-row {
  display: flex;
  gap: 24px;
}

.pa-change-up {
  color: #388e3c;
}

.pa-change-down {
  color: #d32f2f;
}

.section-description {
  font-size: 12px;
  color: #666;
  margin-bottom: 16px;
}

/* ===== PA2-PA6 追加CSS ===== */

/* チャートコンテナ */
.pa-chart-container {
  position: relative;
  height: 300px;
  margin: 16px 0;
}

.pa-radar-container {
  height: 350px;
  max-width: 500px;
  margin: 0 auto;
}

.pa-chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.pa-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.pa-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.pa-dot-king { background: rgba(76, 175, 80, 0.7); }
.pa-dot-conversion { background: rgba(255, 152, 0, 0.7); }
.pa-dot-exposure { background: rgba(33, 150, 243, 0.7); }
.pa-dot-low { background: rgba(158, 158, 158, 0.7); }

.pa-avg-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

/* PA3 広告タイプサマリー */
.pa-ad-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.pa-ad-type-card {
  padding: 8px 16px;
  border-radius: 8px;
  background: #f5f5f5;
  min-width: 100px;
}

.pa-ad-type-card.pa-ad-dependent { background: #ffebee; }
.pa-ad-type-card.pa-ad-organic { background: #e8f5e9; }
.pa-ad-type-card.pa-ad-double { background: #f3e5f5; }
.pa-ad-type-card.pa-ad-direct { background: #fff8e1; }

.pa-ad-type-name {
  font-size: 12px;
  font-weight: 600;
}

.pa-ad-type-count {
  font-size: 18px;
  font-weight: 700;
}

/* PA4 信頼サマリー */
.pa-trust-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.pa-trust-card {
  padding: 8px 16px;
  border-radius: 8px;
  min-width: 100px;
}

.pa-trust-established { background: #e8f5e9; }
.pa-trust-improve { background: #fff3e0; }
.pa-trust-promising { background: #e3f2fd; }
.pa-trust-new { background: #f5f5f5; }

.pa-trust-name {
  font-size: 12px;
  font-weight: 600;
}

.pa-trust-count {
  font-size: 18px;
  font-weight: 700;
}

.pa-trust-desc {
  font-size: 10px;
  color: #666;
}

/* PA5 スコアカード */
.pa-scorecard-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.pa-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pa-select-group label {
  font-size: 12px;
  color: #666;
}

.pa-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
}

.pa-score-details {
  margin-top: 16px;
}

.pa-score-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pa-score-item {
  text-align: center;
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: 8px;
  min-width: 80px;
}

.pa-score-item.pa-score-min {
  background: #ffebee;
  border: 1px solid #f44336;
}

.pa-score-name {
  font-size: 11px;
  color: #666;
}

.pa-score-value {
  font-size: 24px;
  font-weight: 700;
}

.pa-score-diff {
  font-size: 12px;
}

.pa-score-diff.positive { color: #4caf50; }
.pa-score-diff.negative { color: #f44336; }

.pa-score-note {
  text-align: center;
  font-size: 12px;
  color: #f44336;
  margin-top: 12px;
}

/* PA6 ポジショニングテーブル */
.pa-positioning-table {
  font-size: 12px;
}

.pa-positioning-table th,
.pa-positioning-table td {
  padding: 8px;
  vertical-align: middle;
}

.pa-cell-shop {
  font-weight: 600;
  font-size: 11px;
}

.pa-cell-item {
  font-size: 10px;
  color: #666;
}

.pa-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.pa-badge-king { background: #c8e6c9; color: #2e7d32; }
.pa-badge-conversion { background: #ffe0b2; color: #e65100; }
.pa-badge-exposure { background: #bbdefb; color: #1565c0; }
.pa-badge-low { background: #eeeeee; color: #616161; }

.pa-badge-ad-dependent { background: #ffcdd2; color: #c62828; }
.pa-badge-ad-organic { background: #c8e6c9; color: #2e7d32; }
.pa-badge-ad-double { background: #e1bee7; color: #7b1fa2; }
.pa-badge-ad-direct { background: #fff9c4; color: #f57f17; }

.pa-row-king {
  background: #fffde7 !important;
}

.pa-row-quadrant-king td:first-child {
  border-left: 3px solid #4caf50;
}

.pa-row-quadrant-conversion td:first-child {
  border-left: 3px solid #ff9800;
}

.pa-row-quadrant-exposure td:first-child {
  border-left: 3px solid #2196f3;
}

.pa-score-cell {
  width: 80px;
}

.pa-score-bar-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pa-score-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 4px;
}

.pa-score-text {
  font-size: 10px;
  min-width: 20px;
}

.pa-more-note {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

/* PA1散布図用カードノート */
.summary-card .card-note {
  font-size: 10px;
  color: #999;
  margin-top: 4px;
}

/* ============================================================
   ranking_onlyモード用メッセージ（v3.31追加）
   ============================================================ */
.ranking-only-message {
  background-color: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.ranking-only-message p {
  margin: 0;
  color: #e65100;
  font-size: 13px;
}
/* ============================================================
   PA レポートエクスポートフッター（v3.33追加）
   ============================================================ */
.pa-export-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 24px 0;
  margin-top: 24px;
  border-top: 1px solid #e1e4e8;
}

.pa-export-footer .btn {
  min-width: 160px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
}

.pa-export-footer .btn-pdf {
  background: #c62828;
  color: #fff;
  border: none;
}

.pa-export-footer .btn-pdf:hover {
  background: #b71c1c;
}

.pa-export-footer .btn-csv {
  background: #fff;
  color: #24292e;
  border: 1px solid #d1d5da;
}

.pa-export-footer .btn-csv:hover {
  background: #f6f8fa;
  border-color: #c6c8ca;
}

/* エクスポートローディングオーバーレイ */
.pa-export-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.pa-export-modal {
  background: #fff;
  border-radius: 8px;
  padding: 32px 48px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pa-export-modal h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #24292e;
}

.pa-export-progress {
  width: 280px;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.pa-export-progress-bar {
  height: 100%;
  background: #c62828;
  transition: width 0.3s ease;
}

.pa-export-status {
  font-size: 13px;
  color: #586069;
}

/* クライアント管理用スタイル */
.user-stats {
  padding: 8px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-size: 14px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

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

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

.session-count {
  font-family: monospace;
}

.session-count.has-sessions {
  color: #0066cc;
  font-weight: 500;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 11px;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background: #e0a800;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.actions {
  white-space: nowrap;
}

.actions .btn {
  margin-right: 4px;
}

.modal-sm {
  max-width: 400px;
}

.required {
  color: #dc3545;
}

/* ジャンルセル（2段表示） */
.genre-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.genre-cell .genre-name {
  color: #24292e;
  font-size: 13px;
}

.genre-cell .genre-id {
  font-size: 11px;
  color: #6a737d;
}

/* 削除済み行 */
.row-inactive {
  background-color: #f8f8f8;
  opacity: 0.6;
}

.row-inactive td {
  text-decoration: line-through;
  color: #999;
}

/* フォーム静的表示 */
.form-static {
  padding: 8px 0;
  font-weight: 500;
  color: #24292e;
}

/* ========================================
   ウォッチ分析（Phase 24）
   ======================================== */

/* 店舗エリア */
.shop-area {
  margin-bottom: 24px;
}

/* 店舗エリアコンテンツ */
.shop-area-content {
  padding: 16px;
}

/* ジャンルアコーディオン */
.genre-accordion {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
}

.genre-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background-color: #fafafa;
  cursor: pointer;
  user-select: none;
}

.genre-header:hover {
  background-color: #f0f0f0;
}

.genre-header .toggle-icon {
  width: 20px;
  font-size: 12px;
  color: #586069;
  transition: transform 0.2s;
}

.genre-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.genre-header .genre-path {
  font-size: 13px;
  color: #24292e;
  flex: 1;
}

.genre-header .genre-count {
  margin-left: 8px;
  font-size: 12px;
  color: #586069;
}

.genre-header .genre-keyword-link,
.genre-header .genre-ranking-link {
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.7;
}

.genre-header .genre-keyword-link:hover,
.genre-header .genre-ranking-link:hover {
  opacity: 1;
}

.genre-content {
  padding: 0 12px 12px;
}

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

/* さらに見るボタン */
.show-more {
  text-align: center;
  padding: 8px;
  color: #0066cc;
  cursor: pointer;
  font-size: 13px;
}

.show-more:hover {
  text-decoration: underline;
}

/* WA1フィルターボタン */
.wa1-filter-btn {
  margin-right: 4px;
  border: 1px solid #ddd;
  background: #fff;
  color: #586069;
}

.wa1-filter-btn:hover {
  background: #f0f0f0;
}

.wa1-btn-active {
  background: #c62828 !important;
  color: #fff !important;
  border-color: #c62828 !important;
}

/* ウォッチ分析テーブル */
.wa-items-table th,
.wa-items-table td {
  padding: 8px 10px;
  font-size: 13px;
}

.wa-items-table .item-review-rating {
  color: #f9a825;
  font-weight: 500;
}

.wa-items-table .item-review-count {
  color: #586069;
  font-size: 11px;
}

/* ノーデータメッセージ */
.no-data-message {
  text-align: center;
  padding: 40px;
  color: #586069;
}

.no-data-message p:first-child {
  font-size: 16px;
  font-weight: 500;
  color: #24292e;
}

/* 変動表示（共通で使う場合はここ、既存あれば不要） */
.change-up { color: #43a047; font-weight: 500; }
.change-down { color: #e53935; font-weight: 500; }
.change-new { color: #1e88e5; font-weight: 600; }
.change-same { color: #999; }

/* ========================================
   ジャンルID管理 Phase 25追加
   ======================================== */

/* RA列（ランキング取得対象） */
.col-ra {
  width: 50px;
  text-align: center;
}

/* RAマーク */
.ra-mark {
  display: inline-block;
  font-weight: 600;
  font-size: 14px;
}

.ra-mark.ra-yes {
  color: #28a745;
}

.ra-mark.ra-no {
  color: #ccc;
}

/* 件数サマリー */
.rg-summary {
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e1e4e8;
  font-size: 12px;
  color: #586069;
  text-align: right;
}

.rg-summary span {
  font-weight: 600;
  color: #24292e;
}

/* チェックボックスラベル */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ===== PM: 商品市場分析 ===== */
.pm-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.pm-tile {
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: center;
}

.pm-tile:hover {
  border-color: #c62828;
}

/* PM タイル背景色（前週比） */
.pm-tile-positive {
  background: #e3f2fd;
}

.pm-tile-negative {
  background: #ffebee;
}

.pm-tile-rank {
  font-size: 12px;
  color: #586069;
  margin-bottom: 4px;
}

.pm-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: #c62828;
  line-height: 1.3;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
}

.pm-tile-count-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.pm-tile-count {
  font-size: 18px;
  font-weight: 700;
  color: #24292e;
}

.pm-tile-ratio {
  font-size: 11px;
  color: #586069;
}

.pm-tile-change {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.pm-tile-children {
  font-size: 11px;
  color: #586069;
  margin-bottom: 8px;
}

.pm-tile-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.pm-rakuten-link {
  font-size: 11px;
  color: #0366d6;
  text-decoration: none;
}

.pm-rakuten-link:hover {
  text-decoration: underline;
}

.pm-ranking-icon {
  cursor: pointer;
  font-size: 14px;
}

.pm-ranking-icon:hover {
  opacity: 0.7;
}

/* PM 前週比テキスト色 */
.pm-change-positive {
  color: #0366d6;
}

.pm-change-negative {
  color: #e53935;
}

.pm-change-neutral {
  color: #43a047;
}

/* PM セレクター可変幅 */
.pm-selectors {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.pm-selector-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pm-selector-group label {
  font-size: 12px;
  color: #586069;
}

.pm-selector-group select {
  min-width: 120px;
  max-width: 280px;
  width: auto;
}

/* PM2: 推移グラフ */
.pm-info-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.pm-info-item {
  font-size: 13px;
}

.pm-period-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.pm-period-btn {
  background: #f5f5f5;
  border: 1px solid #e1e4e8;
  color: #586069;
}

.pm-period-btn:hover {
  background: #e8e8e8;
}

.pm-period-btn.active {
  background: #c62828;
  border-color: #c62828;
  color: #ffffff;
}

/* PM3: ランキング */
.pm-ranking-section {
  margin-bottom: 24px;
}

.pm-ranking-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.pm-ranking-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pm-ranking-card {
  min-width: 140px;
  max-width: 180px;
  flex: 1;
  cursor: pointer;
}

.pm-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #c62828;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-card-parent {
  font-size: 11px;
  color: #586069;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e8e8e8;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .pm-tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .pm-ranking-cards {
    flex-direction: column;
  }
  
  .pm-ranking-card {
    max-width: 100%;
  }
}

/* PM0: 市場サマリーグラフ */
.pm0-gauge-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px 0;
}

.pm0-gauge-wrap canvas {
  width: 200px !important;
  height: 110px !important;
}

.pm0-gauge-labels {
  text-align: center;
  margin-top: 8px;
}

.pm0-gauge-value {
  font-size: 22px;
  font-weight: 700;
  color: #c62828;
}

.pm0-gauge-sub {
  font-size: 12px;
  color: #586069;
  margin-top: 4px;
}

/* ============================================================ */
/* Phase 26: 市場競争分析 CSS                                    */
/* ============================================================ */

/* 6分類バッジ */
.badge-classification {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.badge-open   { background: #4caf50; color: #fff; }
.badge-guard  { background: #26a69a; color: #fff; }
.badge-battle { background: #ff9800; color: #fff; }
.badge-hard   { background: #c62828; color: #fff; }
.badge-niche  { background: #42a5f5; color: #fff; }
.badge-locked { background: #78909c; color: #fff; }

/* 成長/衰退表示 */
.growth-positive { color: #4caf50; }
.growth-negative { color: #c62828; }
.growth-stable   { color: #78909c; }

/* スコアバー */
.score-bar {
  display: inline-block;
  height: 14px;
  border-radius: 2px;
  vertical-align: middle;
}

.score-bar-bg {
  display: inline-block;
  width: 60px;
  height: 14px;
  background: #e0e0e0;
  border-radius: 2px;
  vertical-align: middle;
  overflow: hidden;
}

/* GA サマリーカード */
.ga-summary-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ga-summary-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 120px;
  text-align: center;
}

.ga-summary-card .card-label {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}

.ga-summary-card .card-value {
  font-size: 20px;
  font-weight: 600;
}

.ga-summary-card .card-change {
  font-size: 12px;
  margin-top: 2px;
}

/* GA スコアバー（PA7互換） */
.ga-score-bar-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ga-score-bar-bg {
  width: 100px;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.ga-score-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
}

.ga-score-text {
  font-size: 11px;
  min-width: 28px;
}

/* GA テーブルヘッダー（グレー帯） */
.ga-report-table thead th {
  background: #f5f5f5;
  border-bottom: 2px solid #e0e0e0;
  padding: 8px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #24292e;
  white-space: nowrap;
}

.ga-report-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.ga-report-table tbody tr:hover {
  background: #f8f9fa;
}

/* GA5 店舗タイル（3列レスポンシブ） */
.ga-shop-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .ga-shop-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .ga-shop-tiles {
    grid-template-columns: 1fr;
  }
}

.ga-shop-tile {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.ga-shop-tile-header {
  background: #f5f5f5;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ga-shop-tile-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}

.ga-shop-rakuten-link {
  color: #c62828;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.ga-shop-rakuten-link:hover {
  text-decoration: underline;
}

.ga-shop-tile-body {
  padding: 10px 12px;
  font-size: 12px;
}

.ga-shop-tile-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid #f5f5f5;
}

.ga-shop-tile-row:last-child {
  border-bottom: none;
}

.ga-shop-tile-label {
  color: #666;
  flex-shrink: 0;
  margin-right: 8px;
}

.ga-shop-tile-other {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e0e0e0;
  font-size: 11px;
  color: #555;
  line-height: 1.5;
}

/* GA6 属性テーブル（PA7互換ゲージ） */
.ga-attr-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.ga-attr-table tr {
  border-bottom: 1px solid #f0f0f0;
}

.ga-attr-label {
  padding: 6px 8px;
  width: 100px;
  white-space: nowrap;
  color: #333;
}

.ga-attr-bar-cell {
  padding: 6px 0;
}

.ga-attr-bar-bg {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.ga-attr-bar {
  height: 100%;
  background: #1976D2;
  border-radius: 4px;
}

.ga-attr-value {
  padding: 6px 8px;
  width: 160px;
  text-align: right;
  white-space: nowrap;
  font-size: 11px;
}

/* GA7 分布バー（PA7互換） */
.ga-dist-row {
  display: flex;
  align-items: center;
  height: 28px;
}

.ga-dist-bar-bg {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.ga-dist-bar-light {
  height: 100%;
  background: #bbdefb;
  border-radius: 4px;
  position: absolute;
}

.ga-dist-bar-dark {
  height: 100%;
  background: #1976D2;
  border-radius: 4px;
  position: absolute;
}

.ga-dist-count {
  width: 130px;
  text-align: right;
  font-size: 11px;
  flex-shrink: 0;
  margin-left: 8px;
}

.ga-dist-label {
  width: 60px;
  text-align: right;
  font-size: 11px;
  flex-shrink: 0;
  margin-left: 4px;
  font-weight: 600;
}

/* GA8 スコア行（PA7互換） */
.ga8-score-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.ga8-score-label {
  width: 64px;
  flex-shrink: 0;
}

.ga8-score-value {
  width: 40px;
  font-weight: 600;
  flex-shrink: 0;
}

.ga8-score-bar-bg {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.ga8-score-bar {
  height: 100%;
  border-radius: 4px;
}

.ga8-score-level {
  width: 60px;
  text-align: right;
  flex-shrink: 0;
  margin-left: 8px;
}

/* GA6 市場標準 3列グリッド */
.ga-market-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.ga-market-cell {
  min-width: 0;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 12px;
  background: #fafafa;
}

.ga-market-cell-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #24292e;
}

@media (max-width: 1200px) {
  .ga-market-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .ga-market-grid {
    grid-template-columns: 1fr;
  }
}

/* GA インサイト */
.ga-insight {
  padding: 8px 12px;
  border-left: 3px solid #e0e0e0;
  margin-bottom: 8px;
  font-size: 13px;
}

.ga-insight-high {
  border-left-color: #c62828;
  background: #fff5f5;
}

.ga-insight-medium {
  border-left-color: #ff9800;
  background: #fff8e1;
}

/* GA 戦略マトリクス */
.ga-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #e0e0e0;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.ga-matrix-cell {
  background: #fff;
  padding: 16px;
}

.ga-matrix-cell h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
}

/* データ不足メッセージ */
.data-insufficient {
  padding: 12px 16px;
  background: #fff3e0;
  border: 1px solid #ff9800;
  border-radius: 4px;
  color: #e65100;
  font-size: 13px;
}

/* NEI率帯バー */
.nei-distribution-bar {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.nei-distribution-bar .bar-label {
  width: 100px;
  flex-shrink: 0;
}

.nei-distribution-bar .bar-visual {
  flex: 1;
  height: 18px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin: 0 8px;
}

.nei-distribution-bar .bar-fill {
  height: 100%;
  border-radius: 2px;
}

.nei-distribution-bar .bar-info {
  width: 200px;
  flex-shrink: 0;
  text-align: right;
}