/* =========================================================
   AI動画面談 インバウンドマーケティングジャパン — 共有デザインシステム
   全モック画面はこの app.css を参照する（創作禁止・統一）
   ========================================================= */

:root {
  --navy: #1b2a4a;
  --navy-2: #24365c;
  --ink: #1f2430;
  --muted: #6b7585;
  --line: #e6e9f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --accent: #3b6ef5;
  --accent-soft: #eaf0ff;
  --rec: #e5484d;
  --ok: #2b9d6e;
  --ok-soft: #e7f6ef;
  --warn: #c98a1b;
  --warn-soft: #fbf2dd;
  --shadow: 0 6px 24px rgba(27, 42, 74, 0.08);
  --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Segoe UI", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------- ブランド / ヘッダー（候補者用・上部固定） ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-inner { max-width: 1080px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); }
.brand .logo { width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.brand .name { font-size: 15px; }
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; display: block; line-height: 1.2; }
.top-spacer { flex: 1; }
.help-link { color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.help-link:hover { color: var(--accent); }

/* ---------- ボタン ---------- */
.btn { border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
  padding: 14px 18px; cursor: pointer; transition: transform .05s, background .2s, opacity .2s;
  display: inline-flex; align-items: center; gap: 9px; justify-content: center; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2f5fe0; }
.btn-ghost { background: #eef1f7; color: var(--ink); }
.btn-ghost:hover { background: #e6eaf2; }
.btn-rec { background: var(--rec); color: #fff; }
.btn-line { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-line:hover { border-color: #cfd6e4; }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- カード ---------- */
.card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- ステータスピル / タグ ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 99px; white-space: nowrap; }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-muted { background: #eef1f7; color: var(--muted); }
.pill .ico-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- 進捗バー（候補者） ---------- */
.progress-wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.progress-row { display: flex; align-items: center; gap: 14px; padding: 14px 0 6px; }
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.progress-label b { color: var(--ink); font-size: 15px; }
.progress-bar { flex: 1; height: 8px; border-radius: 99px; background: #e9edf5; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #5b86ff); transition: width .4s ease; }
.steps { display: flex; gap: 7px; padding: 4px 0 0; }
.steps .dot { flex: 1; max-width: 30px; height: 4px; border-radius: 99px; background: #dde3ee; }
.steps .dot.done { background: var(--accent); }
.steps .dot.now { background: var(--navy); }

/* ---------- 候補者フロー：中央寄せの単一カラム ---------- */
.flow { max-width: 640px; margin: 0 auto; padding: 40px 24px 64px; }
.flow-narrow { max-width: 560px; }
.flow h1 { font-size: 26px; font-weight: 800; line-height: 1.4; margin-bottom: 10px; }
.flow .lead { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.flow-card { padding: 26px; }

/* チェックリスト行 */
.check-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.check-row:first-child { border-top: none; }
.check-row .ic { width: 42px; height: 42px; border-radius: 11px; background: #f1f4fb;
  display: grid; place-items: center; font-size: 19px; flex: none; }
.check-row .body { flex: 1; }
.check-row .body .k { font-weight: 700; font-size: 15px; }
.check-row .body .d { color: var(--muted); font-size: 13px; }
.check-row .state { font-size: 13px; font-weight: 700; }
.check-row .state.ok { color: var(--ok); }
.check-row .state.pend { color: var(--muted); }

/* 注意・ヒント */
.tip { background: #fafbff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 15px; display: flex; gap: 11px; align-items: flex-start; color: var(--muted); font-size: 13px; }
.tip .ic { font-size: 17px; flex: none; }
.note-list { color: var(--muted); font-size: 14px; padding-left: 4px; }
.note-list li { margin: 8px 0; list-style: none; padding-left: 26px; position: relative; }
.note-list li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* ---------- 管理画面：シェル（サイドバー＋メイン） ---------- */
.admin { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #cdd6ea; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { color: #fff; padding: 8px 10px 16px; }
.sidebar .brand small { color: #93a2c4; }
.sidebar .sec { font-size: 11px; letter-spacing: .04em; color: #7d8cb0; padding: 14px 12px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #cdd6ea; text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-item .ic { width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-bottom { margin-top: auto; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 8px; }
.nav-user .av { width: 32px; height: 32px; border-radius: 50%; background: #3a4d77; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }
.nav-user .nm { font-size: 13px; color: #fff; font-weight: 600; }
.nav-user .rl { font-size: 11px; color: #93a2c4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 16px 28px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 19px; font-weight: 800; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar-spacer { flex: 1; }
.content { padding: 24px 28px 56px; max-width: 1180px; width: 100%; }

/* ---------- 統計カード ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 18px 20px; }
.stat .k { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat .delta { font-size: 12px; font-weight: 700; }
.stat .delta.up { color: var(--ok); }

/* ---------- テーブル ---------- */
.panel { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 800; }
.panel-head .spacer { flex: 1; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 700; font-size: 12px;
  padding: 11px 20px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td, .table tbody tr:hover td { background: #fafbff; }
.cand { display: flex; align-items: center; gap: 11px; }
.cand .av { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.cand .nm { font-weight: 700; }
.cand .mail { color: var(--muted); font-size: 12px; }

/* スコアバー */
.score { display: flex; align-items: center; gap: 9px; }
.score .bar { width: 76px; height: 7px; border-radius: 99px; background: #e9edf5; overflow: hidden; }
.score .bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #5b86ff); }
.score .num { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- フォーム ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }

/* トグルスイッチ */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #cfd6e4; border-radius: 99px; transition: .2s; }
.switch .track::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* 設定行 */
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: none; }
.set-row .body { flex: 1; }
.set-row .body .k { font-weight: 700; font-size: 14px; }
.set-row .body .d { color: var(--muted); font-size: 13px; }

/* ---------- 設問エディタ（テンプレ） ---------- */
.q-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; background: #fff; }
.q-item .q-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-item .q-no { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.q-item .handle { color: #b6c0d4; cursor: grab; }
.q-item .q-body { font-weight: 600; }
.q-item .q-cfg { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.q-item .q-cfg b { color: var(--ink); }

/* ---------- 候補者詳細：動画＋文字起こし＋AI所見 ---------- */
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.video-frame { background: #0f1626; border-radius: 14px; aspect-ratio: 16/9; position: relative;
  display: grid; place-items: center; overflow: hidden; }
.video-frame .play { width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.92);
  display: grid; place-items: center; font-size: 22px; color: var(--navy); cursor: pointer; }
.video-frame .vbar { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px; color: #fff; font-size: 12px;
  background: linear-gradient(transparent, rgba(15,22,38,.8)); }
.video-frame .vbar .track { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.3); }
.video-frame .vbar .track > span { display: block; height: 100%; width: 35%; background: #fff; border-radius: 99px; }

.q-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.q-chip { padding: 8px 13px; border-radius: 10px; background: #eef1f7; color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer; border: none; }
.q-chip.active { background: var(--navy); color: #fff; }

.transcript { font-size: 14px; line-height: 1.9; color: #36404f; }
.transcript .ts { color: var(--accent); font-weight: 700; font-size: 12px; margin-right: 6px; }

.ai-block { padding: 18px 20px; }
.ai-block h3 { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ai-block h3 .spark { color: var(--accent); }
.eval-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.eval-row:first-of-type { border-top: none; }
.eval-row .lbl { flex: 1; font-size: 14px; }
.ai-summary { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 14px; line-height: 1.85; color: #2b3a5e; }
.ai-note { font-size: 11px; color: var(--muted); margin-top: 10px; display: flex; gap: 7px; align-items: flex-start; }

/* ---------- 汎用ユーティリティ ---------- */
.muted { color: var(--muted); }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.center { text-align: center; }
.section-title { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .02em;
  text-transform: none; margin-bottom: 12px; }

/* ---------- 完了画面の丸アイコン ---------- */
.done-badge { width: 88px; height: 88px; border-radius: 50%; background: var(--ok-soft);
  color: var(--ok); display: grid; place-items: center; font-size: 42px; margin: 0 auto 22px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; }
  .sidebar .brand { padding: 4px 8px; }
  .sidebar .sec, .nav-bottom, .nav-user { display: none; }
  .nav-item { padding: 8px 11px; }
}
@media (max-width: 560px) {
  .flow { padding: 28px 16px 48px; }
  .flow h1 { font-size: 22px; }
  .flow-card { padding: 20px; }
  .content { padding: 18px 16px 48px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; row-gap: 10px; }
  .topbar h1 { white-space: nowrap; }
  .topbar .topbar-spacer { display: none; }
  .topbar .btn { white-space: nowrap; }
  .topbar .input { flex: 1 1 100%; max-width: 100% !important; order: 9; }
  .table th.hide-sm, .table td.hide-sm { display: none; }
  .table th, .table td { padding: 11px 12px; }
  .set-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .row { flex-direction: column; }
}

/* ---------- アイコン（単色インラインSVG・assets/icons.js が差し込む） ---------- */
i[data-ico] { display: inline-flex; align-items: center; justify-content: center;
  width: 1.05em; height: 1.05em; vertical-align: -0.18em; line-height: 0; flex: none; }
i[data-ico] svg { width: 100%; height: 100%; display: block; }
/* 箱付きアイコン（サイドバー/チェック行/設問メタ等）は少し大きく */
.ic > i[data-ico], .check-row .ic i[data-ico], .q-meta .ic i[data-ico] { width: 1.25em; height: 1.25em; }
.nav-item .ic i[data-ico] { width: 1.15em; height: 1.15em; }
