/* EC事業者向けレイアウト用CSS */

/* サイドバー */
.sidebar {
  width: 250px;
  background: #00897b;
  color: white;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-header {
  background: #00695c;
  padding: 1rem;
  border-bottom: 1px solid #34495e;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  border-bottom: 1px solid #00695c;
}

.sidebar-nav a {
  display: block;
  padding: 1rem;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background-color: #00695c;
}

/* sidebar-nav 内の details/summary も通常のメニューと同じ見た目に揃える */
.sidebar-nav summary {
  display: block;
  padding: 1rem;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.sidebar-nav summary:hover {
  background-color: #00695c;
}

.sidebar-nav details.active > summary {
  background-color: #00695c;
}

.sidebar-nav details > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav details > ul a {
  padding-left: 2rem; /* サブメニューのインデント */
}

/* メインコンテンツ */
.main-content {
  margin-left: 250px;
  min-height: 100vh;
  background-color: #f5f5f5;
}

/* トップバー */
.topbar {
  background: white;
  padding: 1rem 2rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content {
  padding: 2rem;
}

/* メニュートグル */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ユーザードロップダウン */
.user-dropdown {
  position: relative;
}

.user-info-trigger {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  min-width: 200px;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #495057;
  text-decoration: none;
  border-bottom: 1px solid #f8f9fa;
}

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

.dropdown-item.logout {
  color: #dc3545;
}

/* details/summary の左側に出る三角マーカーを非表示 */
summary.details-summary-no-marker {
  list-style: none;
  cursor: pointer;
}
summary.details-summary-no-marker::-webkit-details-marker {
  display: none;
}
summary.details-summary-no-marker::marker {
  content: "";
}

/* 承認ステータス（トグル）: Tailwindのpeer-checkedに依存せず純CSSで選択状態を表現 */
.status-toggle {
  position: relative;
  display: inline-flex;
}

.status-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-toggle-label {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #d1d5db; /* gray-300 */
  background: #ffffff;
  color: #374151; /* gray-700 */
  font-weight: 600;
  font-size: 0.875rem; /* text-sm */
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.status-toggle-label:hover {
  background: #f9fafb; /* gray-50 */
}

.status-toggle-input:checked + .status-toggle-label {
  /* default (fallback). status-toggle--* があればそちらを優先 */
  background: #e5e7eb; /* gray-200 */
  border-color: #d1d5db; /* gray-300 */
  color: #111827; /* gray-900 */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.status-toggle-input:focus-visible + .status-toggle-label {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); /* blue-500 */
}

/* 承認ステータスごとの選択色（一覧のバッジと同じ色味に寄せる） */
.status-toggle--approved .status-toggle-input:checked + .status-toggle-label {
  background: #dcfce7;   /* green-100 */
  border-color: #bbf7d0; /* green-200 */
  color: #166534;        /* green-800 */
}

.status-toggle--pending .status-toggle-input:checked + .status-toggle-label {
  background: #fef9c3;   /* yellow-100 */
  border-color: #fde68a; /* yellow-200 */
  color: #854d0e;        /* yellow-800 */
}

.status-toggle--rejected .status-toggle-input:checked + .status-toggle-label {
  background: #fee2e2;   /* red-100 */
  border-color: #fecaca; /* red-200 */
  color: #991b1b;        /* red-800 */
}

.status-toggle--suspended .status-toggle-input:checked + .status-toggle-label {
  background: #f3f4f6;   /* gray-100 */
  border-color: #e5e7eb; /* gray-200 */
  color: #1f2937;        /* gray-800 */
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle {
    display: block;
  }
}
