/* 運営スタッフ向けレイアウト用CSS */

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

.sidebar-header {
  background: #1e3a8a;
  padding: 1rem;
  border-bottom: 1px solid #3b82f6;
}

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

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

.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: #1e3a8a;
}

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

/* トップバー */
.topbar {
  background: white;
  padding: 1rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.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 #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  display: none;
  z-index: 1000;
}

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

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s ease;
}

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

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

/* 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: "";
}

/* カードスタイル */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.card-body {
  padding: 1.5rem;
}

/* ボタンスタイル */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-success {
  background: #10b981;
  color: white;
}

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

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* テーブルスタイル */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th {
  background: #f8fafc;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e2e8f0;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}

.table tr:hover {
  background: #f8fafc;
}

/* バッジスタイル */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* 承認ステータス（トグル）: 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 */
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

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