/* PeopleHub – HCM風デモUI（架空ブランド） */
:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --text: #1d2d3e;
  --muted: #556b82;
  --border: #d9dee3;
  --primary: #0064d9;
  --primary-hover: #0054b6;
  --primary-soft: #e8f1fb;
  --shell: #ffffff;
  --shell-border: #e5e8eb;
  --ok: #256f3a;
  --ok-bg: #e8f5ec;
  --warn: #c35500;
  --warn-bg: #fff3e6;
  --error: #aa0808;
  --radius: 12px;
  --shadow: 0 0 2px rgba(34, 53, 72, .12), 0 2px 6px rgba(34, 53, 72, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 15px; margin: 0 0 4px; }
.muted { color: var(--muted); margin: 0; }
[hidden] { display: none !important; }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-fill { fill: currentColor; stroke: none; }
.i-sm { width: 14px; height: 14px; }

/* ---------- Shell bar ---------- */
.shellbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 20px;
  background: var(--shell); border-bottom: 1px solid var(--shell-border);
  box-shadow: 0 1px 3px rgba(34, 53, 72, .06);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #0a6ed1, #0040a8); color: #fff; font-weight: 800;
}
.brand-mark-lg { width: 56px; height: 56px; font-size: 26px; border-radius: 14px; margin: 0 auto 12px; }
.mainnav { display: flex; align-items: stretch; height: 100%; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px; height: 100%;
  padding: 0 12px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer;
  border-bottom: 3px solid transparent;
}
.nav-link:hover { color: var(--primary); text-decoration: none; }
.nav-link.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.mainnav .menu-wrap { height: 100%; }
.shell-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search {
  display: flex; align-items: center; gap: 6px; width: 260px; height: 36px; padding: 0 12px;
  background: #eff1f2; border-radius: 18px; color: var(--muted);
}
.search-input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--text); outline: none; }

.omnibox {
  display: flex; align-items: center; gap: 8px; width: 320px; height: 36px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--muted);
}
.omnibox:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.omnibox-icon { display: flex; }
.omnibox-input { flex: 1; min-width: 0; border: 0; font: inherit; color: var(--text); outline: none; }
.omnibox kbd { font: 11px var(--font); padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }

.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: #eff1f2; }
.badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #d20a0a; color: #fff; font-size: 10px; line-height: 16px; font-weight: 700; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #7858ff; color: #fff; font: 700 12px var(--font); cursor: pointer; }

/* ---------- Menus ---------- */
.menu-wrap { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; min-width: 200px; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(34, 53, 72, .18);
}
.menu-right { left: auto; right: 0; }
.menu-wide { min-width: 300px; }
.menu-title { padding: 8px 10px; font-weight: 700; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-title small, .menu-item small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.menu-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--primary-soft); text-decoration: none; }
.menu-item.is-disabled { color: #9aa7b4; cursor: default; }
.menu-item.is-disabled:hover { background: none; }

/* ---------- Release banner ---------- */
.release-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: #e8f1fb; border-bottom: 1px solid #b8d4f3; color: #0b3f7a;
}
.link-btn { border: 0; background: none; color: var(--primary); font: inherit; cursor: pointer; white-space: nowrap; }

/* ---------- Page ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-actions { display: flex; gap: 8px; }
.app-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 20px 80px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border: 1px solid #bcc3ca; border-radius: 8px;
  background: #fff; color: var(--primary); font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--primary-soft); }
.btn:disabled { color: #9aa7b4; border-color: #e1e5e9; background: #fff; cursor: default; }
.btn-emph { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-emph:hover { background: var(--primary-hover); }
.btn.icon-only { width: 36px; padding: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Home tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tiles-v2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tile-wrap { display: flex; }
.tile-wrap > .tile { flex: 1; }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px 20px; min-height: 200px; display: flex; flex-direction: column; }
.tile-head h2 { font-size: 15px; margin-bottom: 12px; }
.tile-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tiles-v2 .tile { border-top: 4px solid var(--primary); }
.kpi { display: flex; align-items: baseline; gap: 4px; }
.kpi-value { font-size: 48px; font-weight: 300; line-height: 1; color: var(--primary); }
.kpi-unit { font-size: 16px; color: var(--muted); }
.todo-list, .news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.todo-list li { display: flex; gap: 10px; align-items: flex-start; }
.todo-list small { display: block; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: none; }
.dot-warn { background: var(--warn); }
.news-list li { display: flex; gap: 12px; }
.news-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-direction: column; gap: 8px; }
.quick .btn { justify-content: flex-start; }

/* ---------- Profile ---------- */
.obj-header { display: flex; align-items: center; gap: 20px; padding: 24px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: #7858ff; color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700; flex: none; }
.obj-title { flex: 1; min-width: 0; }
.obj-title p { margin: 4px 0 0; }
.obj-actions { display: flex; gap: 8px; align-self: flex-start; }
.anchor-bar { display: flex; gap: 24px; padding: 0 8px; margin: 16px 0; border-bottom: 1px solid var(--border); }
.anchor-bar a { padding: 10px 0; color: var(--text); }
.anchor-bar a:first-child { color: var(--primary); border-bottom: 3px solid var(--primary); font-weight: 700; }
.sections { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 24px; }
.edit-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; background: #fff; border-radius: var(--radius); box-shadow: 0 -2px 8px rgba(34, 53, 72, .1); }
.is-editing #sec-contact { outline: 2px solid var(--primary-soft); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; min-width: 0; }
.field-label { font-size: 13px; color: var(--muted); }
.value { font-size: 14px; min-height: 22px; }
.input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid #8396a8; border-radius: 6px;
  background: #fff; color: var(--text); font: inherit;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.input[readonly] { border-color: transparent; background: #f5f6f7; padding-left: 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.req { color: var(--error); }
.hint { color: var(--muted); font-size: 12px; }
.field-v2 .field-label { font-weight: 700; color: var(--text); }
.field-v2 .input { border-radius: 8px; border-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.form-error { color: var(--error); background: #ffeaea; border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; }

/* ---------- Time off ---------- */
.balances { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.balance-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.balance-card b { font-size: 28px; font-weight: 400; color: var(--primary); }
.balance-card small { font-size: 14px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.two-col.has-footer { padding-bottom: 64px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.table .num { text-align: right; }
.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-wait { background: var(--warn-bg); color: var(--warn); }
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 24px; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(34, 53, 72, .08);
}
.footer-bar-actions { display: flex; gap: 8px; }
body:has(.footer-bar) .demo-root { bottom: 76px; }

/* ---------- Goals ---------- */
.goals { display: flex; flex-direction: column; }
.goal { display: flex; align-items: center; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.goal:last-child { border-bottom: 0; }
.goal-main { flex: 1; min-width: 0; }
.goal-progress { display: flex; align-items: center; gap: 10px; width: 220px; flex: none; }
.bar { flex: 1; height: 8px; background: #e5e8eb; border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.chip { display: inline-block; padding: 1px 8px; margin-right: 8px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 12px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(29, 45, 62, .45); }
.modal { width: min(560px, 100%); background: #fff; border-radius: 14px; box-shadow: 0 16px 48px rgba(0, 0, 0, .25); overflow: hidden; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: #fafbfc; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 90; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 8px; background: #1d2d3e; color: #fff; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Demo panel ---------- */
.demo-root { position: fixed; right: 16px; bottom: 16px; z-index: 100; font: 13px/1.5 var(--font); }
.demo-root.is-hidden { display: none; }
.demo-bar { display: flex; align-items: center; gap: 8px; }
.demo-upgrade {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border: 0; border-radius: 22px; background: #2b2d42; color: #fff; font: 700 14px var(--font);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer;
}
.demo-upgrade:hover { background: #3d405b; }
.demo-upgrade.is-revert { background: #fff; color: #2b2d42; border: 2px solid #2b2d42; }
.demo-upgrade.is-revert:hover { background: #f0f0f5; }
.demo-launcher {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: #2b2d42; color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer;
}
.demo-ver { padding: 1px 8px; border-radius: 10px; background: #ffb703; color: #2b2d42; font-size: 12px; }
.demo-panel {
  position: absolute; right: 0; bottom: 52px; width: 380px; max-height: calc(100vh - 100px); overflow: auto;
  padding: 16px; background: #fff; color: #2b2d42; border: 2px solid #2b2d42; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}
.demo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }
.demo-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: #2b2d42; }
.demo-now { margin: 0 0 12px; padding: 8px 10px; background: #fff8e6; border-radius: 8px; }
.demo-now span { color: #6b6f80; }
.demo-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.demo-btn { height: 36px; padding: 0 10px; border: 1px solid #2b2d42; border-radius: 8px; background: #fff; color: #2b2d42; font: 600 13px var(--font); cursor: pointer; }
.demo-btn:hover { background: #f0f0f5; }
.demo-btn:disabled { opacity: .4; cursor: default; }
.demo-primary { background: #2b2d42; color: #fff; }
.demo-primary:hover { background: #3d405b; }
.demo-block { width: 100%; margin-top: 8px; }
.demo-details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.demo-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.demo-list label { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.demo-list label:hover { background: #f5f5fa; }
.demo-list input { margin-top: 3px; }
.demo-list small { display: block; color: #6b6f80; font-size: 12px; }
.demo-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e5e5ee; color: #6b6f80; font-size: 12px; }
.demo-link { border: 0; background: none; padding: 0; color: #c1121f; font: 12px var(--font); cursor: pointer; text-decoration: underline; }

.update-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(245, 246, 247, .96); }
.update-box { text-align: center; width: 320px; }
.update-box p { margin: 4px 0; }
.update-bar { height: 6px; margin-top: 16px; background: #e5e8eb; border-radius: 3px; overflow: hidden; }
.update-bar span { display: block; height: 100%; width: 0; background: var(--primary); animation: upd 1.7s ease-in-out forwards; }
@keyframes upd { to { width: 100%; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .search, .omnibox { width: 200px; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shellbar { flex-wrap: wrap; height: auto; padding: 8px 16px; gap: 8px; }
  .mainnav { order: 3; width: 100%; height: 40px; overflow-x: auto; }
  .search, .omnibox { display: none; }
  .page { padding: 16px 16px 48px; }
  .obj-header { flex-wrap: wrap; }
  .goal { flex-direction: column; align-items: stretch; gap: 8px; }
  .goal-progress { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .demo-panel { width: calc(100vw - 32px); }
}
@media print { .demo-root, .shellbar, .release-banner { display: none; } }
