:root {
      --sidebar-width: 240px;
      --header-height: 56px;
      --brand-color: #1a3c5e;
      --brand-light: #e8f0fe;
    }

    body { background: #f4f6f9; font-size: 0.9rem; }

    /* ===== 起動時セッション確認中ローダー ===== */
    #sessionLoader {
      min-height: 100vh;
      background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%);
      display: flex; align-items: center; justify-content: center;
    }

    /* ===== ログイン ===== */
    /* セッション確認が終わる（未ログインと判明する）まで表示しない。
       表示する場合は JS 側で display:flex に切り替える */
    #loginPage {
      display: none;
      min-height: 100vh;
      background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%);
      align-items: center; justify-content: center;
    }
    .login-card {
      width: 400px;
      border-radius: 12px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }
    .login-logo { font-size: 2.4rem; color: var(--brand-color); }

    /* ===== サイドバー ===== */
    #sidebar {
      position: fixed; top: 0; left: 0;
      width: var(--sidebar-width);
      height: 100vh;
      background: var(--brand-color);
      color: #fff;
      z-index: 200;
      display: flex; flex-direction: column;
      transition: transform .25s ease;
    }
    #sidebar .brand {
      height: var(--header-height);
      display: flex; align-items: center; gap: 10px;
      padding: 0 20px;
      font-weight: 700; font-size: 1.05rem;
      border-bottom: 1px solid rgba(255,255,255,.12);
    }
    #sidebar nav a {
      display: flex; align-items: center; gap: 10px;
      padding: 11px 22px;
      color: rgba(255,255,255,.8);
      text-decoration: none;
      border-radius: 0;
      transition: background .15s;
    }
    #sidebar nav a:hover, #sidebar nav a.active {
      background: rgba(255,255,255,.12);
      color: #fff;
    }
    #sidebar .sidebar-footer {
      margin-top: auto;
      padding: 16px 20px;
      border-top: 1px solid rgba(255,255,255,.12);
      font-size: .82rem; color: rgba(255,255,255,.55);
    }

    /* ===== メインコンテンツ ===== */
    #appPage { display: none; }
    #mainContent {
      margin-left: var(--sidebar-width);
      min-height: 100vh;
    }
    #topbar {
      height: var(--header-height);
      background: #fff;
      border-bottom: 1px solid #dee2e6;
      display: flex; align-items: center;
      padding: 0 24px;
      position: sticky; top: 0; z-index: 100;
      gap: 12px;
    }
    #topbar .page-title { font-weight: 600; font-size: 1rem; flex: 1; }
    .content-area { padding: 28px 28px; }

    /* ===== カード ===== */
    .stat-card {
      border-radius: 10px; border: none;
      box-shadow: 0 2px 8px rgba(0,0,0,.07);
    }
    .stat-card .icon {
      width: 48px; height: 48px; border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.4rem;
    }

    /* ===== テーブル ===== */
    .table-card {
      border-radius: 10px; border: none;
      box-shadow: 0 2px 8px rgba(0,0,0,.07);
      overflow: hidden;
    }
    .table thead th {
      background: #f8f9fa;
      font-weight: 600; font-size: .82rem;
      text-transform: uppercase; letter-spacing: .04em;
      color: #6c757d;
      border-bottom: 2px solid #dee2e6;
      white-space: nowrap;
    }
    .table tbody tr:hover { background: #f8f9ff; }
    .table td { vertical-align: middle; }

    /* ===== バッジ ===== */
    .role-admin { background: #fff3cd; color: #856404; }
    .role-user  { background: #d1e7dd; color: #0a6640; }

    /* ===== アバター ===== */
    .avatar {
      width: 34px; height: 34px; border-radius: 50%;
      display: inline-flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: .85rem; color: #fff;
      flex-shrink: 0;
    }

    /* ===== フォーム検索エリア ===== */
    .search-bar .form-control,
    .search-bar .form-select {
      border-radius: 8px; font-size: .88rem;
    }

    /* ===== モーダル ===== */
    .modal-header { border-bottom: 2px solid #f0f0f0; }
    .modal-footer { border-top: 2px solid #f0f0f0; }
    .required-mark { color: #dc3545; font-size: .8rem; }

    /* ===== トースト ===== */
    .toast-container { z-index: 9999; }

    /* ===== ページネーション ===== */
    .pagination .page-link { font-size: .85rem; border-radius: 6px !important; margin: 0 2px; }

    /* ===== IPグループ ===== */
    .bg-active   { background: #d1e7dd; color: #0a6640; }
    .bg-inactive { background: #e2e3e5; color: #41464b; }

    code.group-name {
      font-size: .85rem;
      background: #f0f4ff;
      color: #1a3c5e;
      padding: 2px 7px;
      border-radius: 4px;
    }

    /* ===== レスポンシブ ===== */
    @media (max-width: 768px) {
      #sidebar { transform: translateX(-100%); }
      #sidebar.open { transform: translateX(0); }
      #mainContent { margin-left: 0; }
    }

/* =========================================================
   ステータスバッジ（credentials / seeds / contents）
   ========================================================= */
.platform-badge {
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* Seed ステータス */
.badge.bg-active  { background: #198754 !important; color: #fff; }
.badge.bg-inactive{ background: #6c757d !important; color: #fff; }

/* コンテンツ ステータス */
.badge.ct-generated { background: #6c757d !important; color: #fff; }
.badge.ct-approved  { background: #198754 !important; color: #fff; }
.badge.ct-rejected  { background: #dc3545 !important; color: #fff; }
.badge.ct-posted    { background: #0d6efd !important; color: #fff; }
.badge.ct-failed    { background: #dc3545 !important; color: #fff; }

/* 承認状態 */
.badge.ct-pending  { background: #ffc107 !important; color: #212529; }
.badge.ct-skipped  { background: #6c757d !important; color: #fff; }

/* テーブル内コード（account_name 等） */
code.group-name {
  background: #f1f3f5;
  color: #495057;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* コンテンツ詳細モーダル */
#contentDetailBody .row > .col-5 {
  font-size: 0.8rem;
  padding-top: 4px;
}
#contentDetailBody .row > .col-7 {
  font-size: 0.83rem;
  padding-top: 4px;
}

/* =========================================================
   コンテンツ編集・バージョン履歴
   ========================================================= */

/* バージョンカード hover */
.version-card:hover {
  background: #f0f4ff !important;
  border-color: #0d6efd !important;
}

/* バージョン履歴モーダルのリスト */
#versionList .version-card {
  transition: background .15s, border-color .15s;
}

/* 編集モーダル 本文エリア */
#ceBodyText {
  min-height: 280px;
  line-height: 1.6;
}

/* 文字カウンター */
#ceCharCount {
  font-variant-numeric: tabular-nums;
}
