/* ============================================================
   admin.css — 管理画面専用CSS（main.cssと併用）
   ============================================================ */

/* レイアウト */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* サイドバー */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1e293b;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.25s ease;
}
.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid #334155;
}
.sidebar-logo span {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.3;
}
.sidebar-logo small {
  font-size: 0.7rem;
  color: #94a3b8;
}
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-group-label {
  padding: 8px 16px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #94a3b8;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.nav-link:hover { background: #273449; color: #e2e8f0; text-decoration: none; }
.nav-link.active { background: #1e3a5f; color: #60a5fa; border-left-color: #2563eb; }
.nav-link .nav-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #334155;
  font-size: 0.8rem;
}
.sidebar-footer a { color: #94a3b8; }
.sidebar-footer a:hover { color: #e2e8f0; }

/* メインコンテンツ */
.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* トップバー */
.topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user { font-size: 0.875rem; color: var(--color-text-muted); }

/* ページコンテンツ */
.page-content {
  padding: 24px;
  flex: 1;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.page-subtitle {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

/* KPIカード */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.kpi-card .kpi-label { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 600; margin-bottom: 8px; }
.kpi-card .kpi-value { font-size: 2rem; font-weight: 700; color: var(--color-text); line-height: 1; }
.kpi-card .kpi-unit  { font-size: 0.875rem; font-weight: 400; color: var(--color-text-muted); margin-left: 4px; }
.kpi-card .kpi-icon  { font-size: 1.5rem; float: right; margin-top: -4px; }

/* テーブル */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table tbody tr:hover { background: #f8fafc; }
.table td a { color: var(--color-primary); }

/* 検索・フィルターバー */
.filter-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { min-width: 160px; }

/* フォームパネル */
.form-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.form-panel-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  padding: 14px 20px;
  font-weight: 700;
  font-size: 0.95rem;
}
.form-panel-body { padding: 20px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ステータスバッジ */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
/* 受注ステータス */
.status-新規         { background: #dbeafe; color: #1d4ed8; }
.status-スタッフ準備中 { background: #fef9c3; color: #92400e; }
.status-稼働待ち     { background: #e0e7ff; color: #4338ca; }
.status-稼働中       { background: #dcfce7; color: #166534; }
.status-入金待ち     { background: #ffedd5; color: #9a3412; }
.status-請求書発行   { background: #f3e8ff; color: #7e22ce; }
.status-全完了       { background: #f1f5f9; color: #475569; }
.status-強制終了     { background: #fee2e2; color: #991b1b; }
/* スタッフステータス */
.status-未稼働       { background: #f1f5f9; color: #475569; }
.status-一時停止中   { background: #fef9c3; color: #92400e; }
.status-退会済み     { background: #fee2e2; color: #991b1b; }

/* ランク表示 */
.rank-stars { color: #f59e0b; letter-spacing: 2px; }

/* ページネーション */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--transition);
}
.pagination a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ハンバーガー（スマホ用） */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 1.4rem;
}

/* ログインページ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 20px;
}
.login-box {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 { font-size: 1.3rem; color: var(--color-text); font-weight: 700; }
.login-logo p  { color: var(--color-text-muted); font-size: 0.85rem; margin-top: 4px; }

/* セクション区切り */
.section { margin-bottom: 28px; }
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-light);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .sidebar-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; }
}
