/* Project Hub v2 共通スタイル(ビルドなし・自前CSS)
   v1のトーン(青 #2563eb ベース)を踏襲。セマンティッククラスで構成 */

:root {
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-50: #eff6ff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --red-600: #dc2626;
  --red-50: #fef2f2;
  --orange-600: #ea580c;
  --green-600: #16a34a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 認証ページ(中央カード) ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(160deg, var(--blue-800), var(--blue-600));
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
}

.auth-brand {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--blue-600);
  margin-bottom: 4px;
}

.auth-sub {
  text-align: center;
  color: var(--gray-600);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-note {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--gray-600);
  text-align: center;
}

/* ---------- フォーム ---------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
}

.input:focus {
  outline: 2px solid var(--blue-600);
  outline-offset: -1px;
  border-color: var(--blue-600);
}

.input-code {
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
  font-variant-numeric: tabular-nums;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-600);
  cursor: pointer;
}

.check input { width: 16px; height: 16px; accent-color: var(--blue-600); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-700); }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-400); }
.btn-danger { background: var(--red-600); color: #fff; }

.alert {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--red-50);
  color: var(--red-600);
  border: 1px solid #fecaca;
}

.hidden { display: none !important; }

/* ---------- MFAセットアップ ---------- */

.qr-box {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.qr-box svg { width: 180px; height: 180px; }

.secret-box {
  font-family: Consolas, monospace;
  font-size: 13px;
  background: var(--gray-50);
  border: 1px dashed var(--gray-400);
  border-radius: var(--radius);
  padding: 8px 10px;
  text-align: center;
  word-break: break-all;
  margin-bottom: 16px;
  user-select: all;
}

.steps { font-size: 13.5px; color: var(--gray-600); margin-bottom: 16px; padding-left: 18px; }
.steps li { margin-bottom: 4px; }

/* ---------- アプリレイアウト(サイドバー+メイン) ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--blue-600);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  font-size: 20px;
  font-weight: 700;
  padding: 22px 20px 16px;
  color: #fff;
}

.sidebar-brand a { color: #fff; }
.sidebar-brand a:hover { text-decoration: none; opacity: 0.85; }

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

.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14.5px;
  margin-bottom: 4px;
}

.sidebar-nav a:hover { background: var(--blue-700); text-decoration: none; }
.sidebar-nav a.active { background: var(--blue-800); font-weight: 600; }

.sidebar-foot {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13.5px;
}

.main { flex: 1; min-width: 0; }

.header {
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 { font-size: 18px; }

.content { padding: 24px; }

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 { font-size: 16px; margin-bottom: 12px; }

.text-muted { color: var(--gray-600); font-size: 13.5px; }

/* ---------- テーブル・バッジ・フォーム行 ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table th { font-size: 12.5px; color: var(--gray-600); background: var(--gray-50); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: #dcfce7; color: var(--green-600); }
.badge-orange { background: #ffedd5; color: var(--orange-600); }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }

.btn-sm { padding: 4px 10px; font-size: 12.5px; font-weight: 500; }

.form-row { display: flex; flex-wrap: wrap; gap: 12px; }
.form-row .field { flex: 1 1 160px; margin-bottom: 8px; }

/* モバイル */
@media (max-width: 767px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding-bottom: 12px; }
  .sidebar-nav a { margin-right: 4px; }
  .sidebar-foot { display: none; }
}
