/* ===== Recogee v2 共通サイドバー CSS ===== */
/* Google Fonts は各HTMLのheadで読み込むこと:
   <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap" rel="stylesheet">
*/

/* ===== CSS カスタムプロパティ（ホワイトラベル対応） ===== */
:root {
  --brand-color: #1a73e8;
  --brand-color-light: rgba(26, 115, 232, 0.15);
  --brand-color-hover: #1557b0;
  --sidebar-bg: #202124;
  --sidebar-text: #9aa0a6;
  --sidebar-text-active: var(--brand-color);
  --body-bg: #e8eaed;
  --card-radius: 16px;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
}

/* ===== ベースリセット ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background: var(--body-bg);
  display: flex;
  min-height: 100vh;
  color: #202124;
}

/* ===== サイドバー ===== */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-logo-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  margin-bottom: 8px;
  display: block;
}
.sidebar-logo-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar-logo-sub {
  font-size: 11px;
  color: #9aa0a6;
  margin-top: 2px;
}

.sidebar-nav { padding: 16px 0; flex: 1; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #e8eaed; }
.nav-item.active {
  background: var(--brand-color-light);
  color: var(--brand-color);
  border-left-color: var(--brand-color);
}

.nav-icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }

/* ===== アコーディオン ===== */
.nav-accordion-trigger { user-select: none; cursor: pointer; }
.nav-accordion-arrow {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.6;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nav-accordion-trigger.open .nav-accordion-arrow { transform: rotate(180deg); }
.nav-accordion-trigger.open,
.nav-accordion-trigger.active-parent { color: #e8eaed; }

.nav-accordion-body { display: none; background: rgba(0, 0, 0, 0.12); }
.nav-accordion-body.open { display: block; }
.nav-sub-item { padding-left: 44px; font-size: 13px; }

/* ===== フッター ===== */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: #5f6368;
}
.sidebar-user-email {
  font-size: 11px;
  color: #9aa0a6;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #9aa0a6;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-align: left;
  margin-bottom: 10px;
}
.btn-signout:hover {
  background: rgba(217, 48, 37, .15);
  color: #ea4335;
  border-color: rgba(217, 48, 37, .3);
}

/* ===== メインエリア ===== */
.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== トップバー ===== */
.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: #202124;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===== コンテンツ ===== */
.content {
  padding: 28px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ===== カード共通 ===== */
.card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

/* ===== ボタン ===== */
.btn-primary {
  background: var(--brand-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-color-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: #f1f3f4;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-secondary:hover:not(:disabled) { background: #e8eaed; }

/* ===== テーブル共通 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: #f8f9fa;
  color: #5f6368;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid #e0e0e0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f3f4;
  color: #202124;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8f9fa; transition: background 0.15s; }

/* ===== バッジ ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-red    { background: #fce8e6; color: #c5221f; }
.badge-yellow { background: #fef7e0; color: #b06000; }
.badge-green  { background: #e6f4ea; color: #137333; }
.badge-blue   { background: #e8f0fe; color: #1a73e8; }
.badge-gray   { background: #f1f3f4; color: #5f6368; }

/* ===== ローディングスピナー ===== */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--brand-color);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== スケルトンローディング ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== トースト通知 ===== */
.toast {
  display: none;
  position: fixed;
  bottom: 28px;
  right: 32px;
  background: #202124;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
  z-index: 9000;
  animation: toastIn .2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== セクション見出し ===== */
.section-heading {
  font-size: 11px;
  font-weight: 700;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

/* ===== フォーム ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3c4043;
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  display: block;
  width: 100%;
  border: 1.5px solid #dadce0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #202124;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-light);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ===== フッター ===== */
.footer {
  text-align: center;
  font-size: 11px;
  color: #9aa0a6;
  padding-bottom: 8px;
}
