/* ==============================================
   グローバル設定とリセット
   ============================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* カラーパレット - 画像に基づく */
  --sidebar-bg: #5a6c7d;
  --sidebar-text: #e2e8f0;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: #4a5568;
  --main-bg: #f7f9fc;
  --card-bg: #ffffff;
  --primary-green: #6cc4a1;
  --primary-blue: #5b6fa8;
  --danger-red: #ef5350;
  --text-dark: #1a202c;
  --text-gray: #718096;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--main-bg);
  color: var(--text-dark);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* ==============================================
   レイアウト構造
   ============================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  transition: margin-left 0.3s ease;
}

/* ==============================================
   サイドバー
   ============================================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #5a6c7d 0%, #4a5568 100%);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

/* サイドバーヘッダー */
.sidebar-header {
  margin-bottom: 2rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.5rem 0;
}

.sidebar-logo svg {
  flex-shrink: 0;
}

/* プロフィールセクション */
.sidebar-profile {
  text-align: center;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.profile-status {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  background: var(--primary-green);
  border: 3px solid var(--sidebar-bg);
  border-radius: 50%;
}

.profile-name {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: gold;
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 12px;
  margin-top: 0.5rem;
}

/* ナビゲーションメニュー */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--sidebar-text-active);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 1rem 0;
}

/* サイドバーフッター */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.add-button {
  display: block;
  text-decoration: none;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  text-align: center;
}

.add-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.add-button-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.add-button-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sidebar-text);
}

.add-button-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-button-icon svg {
  color: white;
}

/* ==============================================
   メインコンテンツエリア
   ============================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

/* ヘッダー */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

/* カード */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* フォーム要素 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  background: white;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(108, 196, 161, 0.1);
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-green);
  color: white;
}

.btn-primary:hover {
  background: #5ab391;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 196, 161, 0.3);
}

.btn-secondary {
  background: var(--primary-blue);
  color: white;
}

.btn-secondary:hover {
  background: #4a5e97;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 111, 168, 0.3);
}

.btn-danger {
  background: var(--danger-red);
  color: white;
}

.btn-danger:hover {
  background: #e53935;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-dark);
}

.btn-outline:hover {
  background: var(--main-bg);
  border-color: var(--primary-green);
  color: var(--primary-green);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
}

/* テーブル */
.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-color);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-gray);
  font-size: 0.9375rem;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(108, 196, 161, 0.05);
}

/* アラート */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-info {
  background: rgba(108, 196, 161, 0.1);
  border-color: var(--primary-green);
  color: #2d7a5e;
}

.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  border-color: #ffc107;
  color: #856404;
}

.alert-danger {
  background: rgba(239, 83, 80, 0.1);
  border-color: var(--danger-red);
  color: #c62828;
}

/* バッジ */
.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary {
  background: var(--primary-green);
  color: white;
}

.badge-secondary {
  background: var(--primary-blue);
  color: white;
}

.badge-danger {
  background: var(--danger-red);
  color: white;
}

/* ==============================================
   レスポンシブデザイン
   ============================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* ==============================================
   ユーティリティクラス
   ============================================== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.gap-2 {
  gap: 1rem;
}

/* ==============================================
   アニメーション
   ============================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in {
  animation: slideIn 0.3s ease;
}
