/* 経歴ポートフォリオサイト 共通スタイル
   - 入力・管理画面: 社内向けテイスト(フラット・入力効率重視)
   - プレゼン画面(.present): 社外向けテイスト(余白・インディゴのアクセント)
   CSPで外部CSS・インラインスタイルを禁止しているため、スタイルはすべてこのファイルに置く */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef2ff;
  --accent-2: #7c3aed;
  --ok: #059669;
  --danger: #e11d48;
  --radius: 10px;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", "Yu Gothic UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.7; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.mt { margin-top: 24px; }
.mt-s { margin-top: 8px; }

/* ---------- ヘッダー ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.inline { display: inline; margin: 0; }

main.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px 60px; }

/* ---------- 共通部品 ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.btn { display: inline-block; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; font-family: inherit; line-height: 1.4; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.link { border: none; background: none; color: var(--muted); padding: 0; }
.btn.link:hover { color: var(--accent); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.alert.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert ul { margin: 0; padding-left: 1.2em; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
table.grid th { background: #f1f5f9; font-weight: 600; color: #334155; white-space: nowrap; }
table.grid td.c, table.grid th.c { text-align: center; }
.table-scroll { overflow-x: auto; }

/* ---------- フォーム ---------- */
.form-grid { display: grid; grid-template-columns: 180px 1fr; gap: 12px 16px; align-items: start; }
.form-grid label.l { font-weight: 600; font-size: 14px; padding-top: 7px; }
.form-grid .req::after { content: " *"; color: var(--danger); }
input[type=text], input[type=password], input[type=month], input[type=number], select, textarea {
  font-family: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; width: 100%; max-width: 520px; }
textarea { max-width: 100%; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.short, select.short { max-width: 180px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--danger); font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { font-size: 14px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tech-group { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.tech-group h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.tech-item { display: inline-flex; align-items: center; gap: 4px; margin: 3px 12px 3px 0; font-size: 14px; }
.tech-item input[type=text] { width: 90px; padding: 3px 6px; font-size: 12px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

/* ---------- ログイン ---------- */
.auth { max-width: 400px; margin: 60px auto; }
.auth h1 { font-size: 20px; }
.auth .brand-lg { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.auth .brand-lg span { color: var(--accent); }
.auth input { max-width: 100%; }
.auth .row { margin-bottom: 14px; }
.qr { text-align: center; margin: 12px 0; }
.secret { font-family: ui-monospace, Consolas, monospace; background: #f1f5f9; padding: 6px 10px; border-radius: 6px; word-break: break-all; font-size: 13px; }
.code-input { font-size: 22px !important; letter-spacing: 6px; text-align: center; }

/* ---------- 要員一覧 ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.person-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: block; color: var(--text); }
.person-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 4px 14px rgba(79, 70, 229, .08); }
.person-card .ini { font-size: 26px; font-weight: 800; }

/* ---------- プレゼン画面 ---------- */
.present { font-size: 16px; }
.present .section { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 32px; margin-bottom: 24px; }
.present .section h2 { font-size: 20px; display: flex; align-items: baseline; gap: 10px; }
.present .section h2 .en { font-size: 12px; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; font-weight: 700; }
.hero { background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 55%, #ffffff 100%); border: 1px solid #e0e7ff; border-radius: 20px;
  padding: 36px 36px 30px; margin-bottom: 24px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.hero .avatar { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 38px; font-weight: 800; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.hero .kpis { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 12px; }
.hero .kpi b { display: block; font-size: 30px; font-weight: 800; color: var(--text); line-height: 1.1; }
.hero .kpi span { font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.hero .pr { color: #334155; margin: 0; }


/* 役割別の円グラフ(ドーナツ)。色は役割ごとに固定し、並びや人数が変わっても同じ役割は同じ色 */
.role-PG { --role: #2a78d6; }
.role-SE { --role: #eb6834; }
.role-TL { --role: #1baf7a; }
.role-PL { --role: #eda100; }
.role-PM { --role: #e87ba4; }
/* 業種の円グラフ: 経験の長い順に1〜5番の色、6位以下は「その他」(中立の灰色) */
.ser-1 { --role: #2a78d6; }
.ser-2 { --role: #eb6834; }
.ser-3 { --role: #1baf7a; }
.ser-4 { --role: #eda100; }
.ser-5 { --role: #e87ba4; }
.ser-other { --role: #a8a29e; }
.role-legend tr.folded td { font-size: 13px; color: var(--muted); white-space: normal; border-bottom: none; padding-top: 10px; }
.role-share { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: center; margin-bottom: 22px; }
.donut { width: 100%; max-width: 240px; }
.donut .slice { fill: var(--role); stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; }
.donut .slice:hover { opacity: .82; }
.donut .donut-total { font-size: 26px; font-weight: 800; fill: var(--text); }
.donut .donut-caption { font-size: 11px; fill: var(--muted); }
.role-legend { border-collapse: collapse; font-size: 15px; width: 100%; max-width: 480px; }
.role-legend caption { text-align: left; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.role-legend td { padding: 6px 14px 6px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.role-legend .num { text-align: right; font-variant-numeric: tabular-nums; }
.role-legend .pct { color: var(--muted); }
.role-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--role); margin-right: 8px; vertical-align: -1px; }


.tech-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px 28px; }
.tech-cat h3 { font-size: 14px; color: var(--muted); margin-bottom: 6px; letter-spacing: .05em; }
.tech-row { display: grid; grid-template-columns: 130px 1fr 64px 30px; gap: 8px; align-items: center; font-size: 14px; margin: 3px 0; }
.tech-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tech-row .yr { text-align: right; color: #334155; font-variant-numeric: tabular-nums; }
.tech-row .lv { text-align: center; font-weight: 700; color: var(--accent); font-size: 13px; }
svg.bar { display: block; width: 100%; height: 10px; }
svg.bar .track { fill: #eef2f7; }
svg.bar .fill { fill: url(#barGradient); }
svg.bar .fill.plain { fill: var(--accent); }

table.matrix { border-collapse: collapse; width: 100%; font-size: 14px; }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--border); padding: 8px 6px; }
table.matrix th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.matrix td.m { text-align: center; color: var(--accent); font-size: 16px; }
table.matrix td.name { min-width: 220px; }
table.matrix tfoot td { font-weight: 700; text-align: center; background: #f8fafc; }
/* 担当工程: 案件が多いと工程名が見えなくなるため、表の中でスクロールさせ、見出し(工程名)と合計行を固定する */
.matrix-scroll { max-height: 70vh; overflow: auto; border-radius: 8px; }
table.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
table.matrix tfoot td { position: sticky; bottom: 0; z-index: 1; box-shadow: inset 0 1px 0 var(--border); }

.projects { display: grid; gap: 14px; }
.project { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: 150px 1fr; gap: 16px; }
.project .period { font-size: 13px; color: var(--muted); }
.project .role { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; border-radius: 999px; padding: 1px 10px; margin-top: 4px; }
.project .title { font-weight: 700; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: #f1f5f9; border-radius: 999px; padding: 1px 10px; font-size: 12px; color: #334155; }
.chip.ph { background: var(--accent-soft); color: var(--accent-dark); }
.certs { display: flex; flex-wrap: wrap; gap: 10px; }
.cert { border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; font-size: 14px; }
.cert small { color: var(--muted); margin-left: 6px; }

.present-bar { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 16px; }
.present-bar a { font-size: 12px; color: #94a3b8; }

.detail dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; }
.detail dt { font-weight: 600; color: var(--muted); font-size: 14px; }
.detail dd { margin: 0; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .role-share { grid-template-columns: 1fr; justify-items: center; }
  .project { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .present .section { padding: 20px; }
}

@media print {
  .topbar, .toolbar, .present-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .present .section, .hero { break-inside: avoid; }
  .matrix-scroll { max-height: none; overflow: visible; }
}
