:root {
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #16203a;
  --sub: #4a5572;
  --muted: #8a93a8;
  --line: #e3e7ef;
  --brand: #1b2a4a;
  --brand-2: #2d4a8a;
  --brand-3: #4f73d9;
  --brand-soft: #e8edf8;
  --brand-grad: linear-gradient(135deg, #1b2a4a 0%, #2d4a8a 60%, #4f73d9 100%);
  --gold: #d9b24a;
  --gold-soft: #fbf3dc;
  --ok: #1f9d55; --ok-bg: #e3f6eb;
  --mid: #c47d0a; --mid-bg: #fff2d6;
  --danger: #d03b3b; --danger-bg: #fde8e8;
  --none: #a4acbf; --none-bg: #eef1f6;
  --shadow: 0 1px 2px rgba(22,32,58,.05), 0 8px 24px -12px rgba(22,32,58,.18);
  --shadow-lg: 0 20px 50px -20px rgba(22,32,58,.35);
  --r: 18px; --r-sm: 12px;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: var(--brand-2); text-decoration: none; }
button { font: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 起動・ログイン */
.boot { min-height: 100vh; display: grid; place-items: center; gap: 16px; align-content: center; }
.boot img { height: 64px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: var(--brand-grad); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(217,178,74,.18); }
.login-hero .logo-chip { background: #fff; border-radius: 16px; padding: 14px 18px; display: inline-flex; width: max-content; }
.login-hero .logo-chip img { height: 54px; }
.login-hero h1 { font-size: 34px; line-height: 1.3; margin: 0 0 12px; letter-spacing: .02em; }
.login-hero p { opacity: .85; margin: 0; max-width: 420px; }
.login-hero .gold { color: var(--gold); }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { padding: 32px 24px; min-height: 260px; } .login-hero h1 { font-size: 24px; } }

/* ---------- フォーム部品 */
label.f { display: block; font-size: 12px; color: var(--sub); font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(79,115,217,.15); }
textarea { min-height: 72px; resize: vertical; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; border-radius: 10px; padding: 10px 16px; font-weight: 600; background: var(--brand); color: #fff; transition: transform .05s, filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold); color: #1b2a4a; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--brand-soft); filter: none; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; padding: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }

/* ---------- レイアウト */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #c9d2e8; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 6px 18px; }
.side .brand .chip { background: #fff; border-radius: 12px; padding: 6px 8px; display: grid; place-items: center; }
.side .brand .chip img { height: 34px; display: block; }
.side .brand b { color: #fff; font-size: 15px; display: block; line-height: 1.2; }
.side .brand small { color: var(--gold); font-size: 11px; letter-spacing: .08em; }
.side .sec { font-size: 11px; letter-spacing: .1em; color: #7f8bb0; margin: 14px 10px 4px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #c9d2e8; font-weight: 500; }
.side a.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side a.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.nav.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side a.nav .cnt { margin-left: auto; background: var(--gold); color: var(--brand); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.side .me { margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); }
.side .me b { color: #fff; display: block; }
.side .me small { color: #9aa6c8; }
.side .me .row { display: flex; gap: 6px; margin-top: 8px; }
.side .me .row .btn { flex: 1; justify-content: center; background: rgba(255,255,255,.1); }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(238,241,246,.85); backdrop-filter: blur(10px); padding: 18px 28px 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top h1 { font-size: 22px; margin: 0; letter-spacing: .02em; }
.top .crumb { color: var(--muted); font-size: 12px; }
.top .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand-2); white-space: nowrap; }
.pill.gold { background: var(--gold-soft); color: #8a6a12; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.mid { background: var(--mid-bg); color: var(--mid); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.none { background: var(--none-bg); color: var(--muted); }
.content { padding: 8px 28px 48px; }
.mtop { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .mtop { display: inline-flex; }
  .top { padding: 12px 16px; }
  .content { padding: 8px 16px 40px; }
}

/* ---------- カード・グリッド */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g21 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g21 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g4, .g3, .g2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card .hint { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h3 { margin: 0; }
.card-h .grow { flex: 1; }
.kpi { position: relative; overflow: hidden; }
.kpi .lab { color: var(--sub); font-size: 12px; font-weight: 600; }
.kpi .val { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin-top: 4px; }
.kpi .val small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.kpi .foot { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.hero { background: var(--brand-grad); color: #fff; }
.kpi.hero .lab, .kpi.hero .foot, .kpi.hero .val small { color: rgba(255,255,255,.75); }
.kpi.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 22px solid rgba(217,178,74,.25); }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand-2); }
.kpi.hero .bar { background: rgba(255,255,255,.2); }
.kpi.hero .bar > i { background: var(--gold); }

/* ---------- 表 */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f7f9fc; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl input { padding: 6px 8px; border-radius: 8px; }
.who { display: flex; align-items: center; gap: 10px; }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--brand-2); flex: none; }
.who b { display: block; line-height: 1.2; }
.who small { color: var(--muted); }

/* ---------- 評価点リング */
.ring { --p: 0; --c: var(--brand-2); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 5px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 13px; }
.ring.lg { width: 132px; height: 132px; }
.ring.lg::before { inset: 12px; }
.ring.lg b { font-size: 34px; }
.ring.lg small { position: absolute; bottom: 30px; font-size: 11px; color: var(--muted); }

.pitch { font-weight: 800; font-size: 15px; }
.pitch.up { color: var(--ok); }
.pitch.down { color: var(--danger); }
.pitch.zero { color: var(--muted); }

/* ---------- 週報 */
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav .lbl { font-weight: 700; min-width: 190px; text-align: center; }
.metric { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 6px; }
.metric .t { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.metric .t b { font-size: 14px; }
.metric .t small { color: var(--muted); }
.metric .inp { display: flex; align-items: center; gap: 8px; }
.metric .inp span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.metric .prog { font-size: 12px; color: var(--sub); }
.metric .bar { margin-top: 0; }
.metric .bar > i.ok { background: var(--ok); }
.metric .bar > i.warn { background: var(--mid); }
.texts { display: grid; gap: 4px; }
.weekdots { display: flex; gap: 4px; flex-wrap: wrap; }
.weekdots i { width: 14px; height: 14px; border-radius: 4px; background: var(--line); display: block; cursor: pointer; }
.weekdots i.submitted { background: var(--brand-3); }
.weekdots i.checked { background: var(--brand); }
.weekdots i.draft { background: var(--gold); }
.weekdots i.cur { outline: 2px solid var(--gold); outline-offset: 1px; }
.boss { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; }

/* ---------- 提出状況ボード */
.board td.cell { padding: 4px 2px; text-align: center; }
.board td.cell i { display: inline-block; width: 18px; height: 18px; border-radius: 5px; background: var(--line); }
.board td.cell i.submitted { background: var(--brand-3); }
.board td.cell i.checked { background: var(--brand); }
.board td.cell i.draft { background: var(--gold); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--sub); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; background: var(--line); }
.legend i.submitted { background: var(--brand-3); }
.legend i.checked { background: var(--brand); }
.legend i.draft { background: var(--gold); }

/* ---------- ラダー */
.ladder { display: grid; grid-template-columns: repeat(11, minmax(0,1fr)); gap: 3px; margin-top: 6px; }
.ladder span { font-size: 10.5px; text-align: center; padding: 4px 2px; border-radius: 6px; background: #f3f5fa; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ladder span.hit { background: var(--brand); color: #fff; font-weight: 700; }
.ladder span.empty { background: transparent; }
.ladder .sc { font-size: 10px; color: var(--muted); text-align: center; }

/* ---------- 役割定義 */
.role { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card); }
.role h4 { margin: 0; font-size: 15px; }
.role .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.role .it { padding: 10px 0; border-top: 1px dashed var(--line); }
.role .it .row { display: flex; justify-content: space-between; gap: 10px; }
.role .w { font-weight: 800; color: var(--brand-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-m { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.tabs { display: flex; gap: 4px; background: #fff; padding: 4px; border-radius: 12px; box-shadow: var(--shadow); width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--sub); font-weight: 600; white-space: nowrap; }
.tabs button.on { background: var(--brand); color: #fff; }

/* ---------- 賞与マトリクス */
.mx { border-collapse: separate; border-spacing: 3px; width: 100%; }
.mx th { font-size: 11px; color: var(--muted); font-weight: 600; padding: 2px 4px; white-space: nowrap; }
.mx td { text-align: center; border-radius: 8px; padding: 8px 2px; font-size: 12px; background: #f3f5fa; position: relative; }
.mx td .n { position: absolute; top: 2px; right: 4px; font-size: 10px; font-weight: 800; color: var(--gold); }
.mx td.has { outline: 2px solid var(--gold); }

/* ---------- 昇格 */
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.steps .s { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--sub); }
.steps .s.now { background: var(--brand); color: #fff; }
.steps .s.next { background: var(--gold); color: var(--brand); font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.check .auto { font-size: 11px; color: var(--muted); }

/* ---------- タスク */
.tl { display: grid; gap: 8px; }
.task { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.task.done { opacity: .6; }
.task.done .w { text-decoration: line-through; }
.task .w { font-weight: 600; }
.task small { color: var(--muted); }
.task input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ok); }

/* ---------- グラフ */
.chart { position: relative; }
.chart svg { width: 100%; display: block; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--brand); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.chart .tip.on { opacity: 1; }
.axis { fill: var(--muted); font-size: 10px; }
.gridl { stroke: var(--line); stroke-width: 1; }

/* ---------- その他 */
.empty { text-align: center; color: var(--muted); padding: 32px; }
.note { background: var(--brand-soft); border-radius: 12px; padding: 10px 14px; color: var(--brand); font-size: 13px; }
.note.warn { background: var(--mid-bg); color: #7a4e05; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-flex .grow { flex: 1; }
.sticky-bar { position: sticky; bottom: 0; margin-top: 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 4; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0; transition: all .2s; z-index: 50; pointer-events: none; }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--danger); }
.modal { position: fixed; inset: 0; background: rgba(22,32,58,.45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal-card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.modal-card h3 { margin-top: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.salary { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.salary .box { background: #f6f8fc; border-radius: 12px; padding: 12px; text-align: center; }
.salary .box b { font-size: 18px; display: block; }
.salary .box small { color: var(--muted); }
.salary .arrow { color: var(--gold); font-size: 22px; font-weight: 800; }
.mono { font-family: Consolas, monospace; }

/* ---------- メニューの親子 */
.navgrp .kids { display: none; margin: 2px 0 6px 22px; border-left: 1px solid rgba(255,255,255,.12); padding-left: 8px; }
.navgrp.open .kids { display: block; }
.side a.nav.parent .chev { margin-left: auto; transition: transform .15s; opacity: .6; }
.navgrp.open a.nav.parent .chev { transform: rotate(90deg); }
.side a.nav.parent.act { color: #fff; }
.side a.nav.kid { padding: 7px 12px; font-size: 13px; }
.navgrp:hover .kids { display: block; }

/* ---------- 週報：月のタブと週のカード */
.mtabs { display: flex; gap: 6px; margin-top: 16px; overflow-x: auto; padding-bottom: 2px; }
.mtab { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 6px 14px; cursor: pointer; display: grid; text-align: center; min-width: 76px; color: var(--text); }
.mtab small { color: var(--muted); font-size: 11px; }
.mtab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mtab.on small { color: rgba(255,255,255,.75); }
.mtab[disabled] { opacity: .45; cursor: default; }
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.wcard { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.wcard:hover { border-color: var(--brand-3); }
.wcard .t { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.wcard .d { font-weight: 700; font-size: 15px; }
.wcard .d small { color: var(--muted); font-weight: 500; font-size: 11px; }
.wcard .r { color: var(--muted); font-size: 12px; }
.wcard.on { border: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(217,178,74,.18); background: var(--gold-soft); }
.wcard[disabled] { opacity: .5; cursor: default; background: #f6f8fc; }

/* ---------- 週の目標と判定 */
.metric .goal { font-size: 13px; color: var(--text); background: var(--brand-soft); border-radius: 8px; padding: 4px 8px; }
.metric .goal b { font-size: 15px; color: var(--brand); }
.metric .judge { font-size: 12.5px; min-height: 0; }
.metric .judge:empty { display: none; }
.sumx { display: grid; gap: 6px; }
.sline { font-size: 13.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sline:last-child { border-bottom: 0; }

input.ovr { background: var(--gold-soft); border-color: var(--gold); font-weight: 700; }
input::placeholder { color: #b3bacb; }

/* 週報の設計・親子 */
.metric.dep1 { border-left: 4px solid var(--gold); }
.metric.dep2 { border-left: 4px solid #e9d8a6; }
.metric .crumb { font-size: 11px; color: var(--muted); margin-bottom: -4px; }
.metric input[readonly] { background: var(--gold-soft); font-weight: 700; }
.dtbl .nm { display: flex; align-items: center; gap: 6px; }
.dtbl .tree { color: var(--muted); font-size: 12px; }
.dtbl .ops .btn { padding: 3px 8px; min-width: 0; }
.dtbl select, .dtbl input { font-size: 13px; }

/* 役割定義の編集 */
.ladder.edit { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.ladder.edit .lc { display: grid; gap: 2px; text-align: center; }
.ladder.edit .sc { font-size: 11px; color: var(--muted); font-weight: 700; }
.ladder.edit input { padding: 5px 3px; font-size: 12px; text-align: center; }
.ladder.edit small { font-size: 10px; color: var(--brand-2); min-height: 12px; word-break: break-all; }
.mini { display: grid; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
.mini select, .mini input { font-size: 13px; }
.ritem .ops .btn { padding: 3px 8px; }
@media (max-width: 760px) { .ladder.edit { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
input[id^="e_"]:not([type=checkbox]), select[id^="e_"] { width: 100%; }
.ritem input[data-f="name"], .ritem input[data-f="sub"] { width: auto; }

/* 役割定義：Excel と同じ表 */
.xfilter .seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.xfilter .seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 8px; font-weight: 700; color: var(--sub); cursor: pointer; }
.xfilter .seg button.on { background: var(--brand); color: #fff; }
.xsheet { border-collapse: collapse; width: auto; font-size: 12.5px; table-layout: fixed; }
.xsheet th { background: var(--brand); color: #fff; font-weight: 600; padding: 6px 3px; border: 1px solid #2c3d63; text-align: center; font-size: 12px; line-height: 1.2; }
.xsheet th.goal { background: #8a6a12; }
.xsheet th small { display: block; font-size: 9px; font-weight: 400; opacity: .85; }
.xsheet td { border: 1px solid #dfe3ea; padding: 0; background: #fff; vertical-align: middle; height: 30px; }
.xsheet td.ro { padding: 5px 6px; line-height: 1.35; word-break: break-all; }
.xsheet td.c { text-align: center; }
.xsheet td.goal { background: #fff8e1; }
.xsheet td.lnk { background: var(--gold-soft); }
.xsheet td.rule { color: var(--sub); font-size: 11.5px; }
.xsheet td.nm { font-weight: 700; }
.xsheet td.nm.same { color: var(--muted); font-weight: 400; }
.xsheet td.bad, .xsheet td.ro.bad { background: var(--danger-bg) !important; color: var(--danger); }
.xsheet td.ok { color: var(--ok); }
.xsheet tfoot td { background: #f4f6fa; font-weight: 700; }
.xsheet input { border: 0; border-radius: 0; width: 100%; padding: 6px 3px; background: transparent; font-size: 12.5px; text-align: center; box-shadow: none; min-height: 0; }
.xsheet input.l { text-align: left; font-size: 11.5px; color: var(--sub); }
.xsheet td.nm input { text-align: left; font-weight: 700; }
.xsheet td.nm.same input { color: var(--muted); font-weight: 400; }
.xsheet input:focus { outline: 2px solid var(--gold); outline-offset: -2px; background: #fffdf4; }
.xsheet td.lnk b { display: block; font-size: 12px; padding-top: 3px; }
.xsheet td.lnk input.rt { font-size: 10px; color: #8a6a12; padding: 0 2px 3px; }
.xsheet .kd { display: inline-block; font-size: 9px; padding: 0 5px; border-radius: 6px; margin-left: 4px; font-weight: 600; vertical-align: middle; }
.xsheet td.nm { position: relative; }
.xsheet.edit td.nm .kd { position: absolute; right: 3px; top: 3px; }
.xsheet .kd.w { background: var(--brand-soft); color: var(--brand-2); }
.xsheet .kd.d { background: var(--ok-bg); color: var(--ok); }
.xsheet .kd.m { background: var(--none-bg); color: var(--muted); }
.xsheet td.ops button { border: 0; background: transparent; cursor: pointer; color: var(--sub); padding: 2px 4px; font-size: 12px; }
.xsheet td.ops button:hover { color: var(--brand); background: var(--brand-soft); border-radius: 6px; }
.xsheet td.lnk .rtw { display: flex; align-items: center; justify-content: center; font-size: 10px; color: #8a6a12; }
.xsheet td.lnk .rtw input.rt { width: 3.4em; text-align: right; }

/* 週報の目標 */
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 700; color: var(--sub); cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }
.gtbl input[data-mk], .gtbl input[data-wk] { width: 124px; text-align: right; font-variant-numeric: tabular-nums; }
/* スクロールしても月の見出しと行の名前が見えるように */
.gwrap { max-height: calc(100vh - 230px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin: 0; }
.gtbl thead th { position: sticky; top: 0; z-index: 3; background: var(--brand); color: #fff; border-bottom: 0; vertical-align: bottom; }
.gtbl thead th small { color: rgba(255,255,255,.75); }
.gtbl thead th .mname { font-size: 16px; font-weight: 800; color: #fff; }
.gtbl thead th .btn { margin-top: 4px; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.gtbl th:first-child, .gtbl td:first-child { position: sticky; left: 0; z-index: 2; }
.gtbl thead th:first-child { z-index: 4; }
.gtbl tbody td:first-child { background: inherit; }
.gtbl tbody tr { background: var(--card); }
/* 親子の色：1段目の親＝紺、2段目の親＝金、3段目の親＝緑。子は親の色の帯 */
.gtbl tr.lv0.par { background: #dfe6f3; }
.gtbl tr.lv0.par td { font-weight: 700; border-top: 2px solid #1b2a4a; }
.gtbl tr.lv0.par td:first-child { box-shadow: inset 6px 0 0 #1b2a4a; }
.gtbl tr.lv1.par { background: #f8ecc4; }
.gtbl tr.lv1.par td:first-child { box-shadow: inset 6px 0 0 #c9a227; }
.gtbl tr.lv2.par { background: #e2f1e4; }
.gtbl tr.lv2.par td:first-child { box-shadow: inset 6px 0 0 #2e7d32; }
.gtbl tr.lv1.kid td:first-child { box-shadow: inset 6px 0 0 #9fb0d0; }
.gtbl tr.lv2.kid td:first-child { box-shadow: inset 6px 0 0 #e3c96a; }
.gtbl tr.lv0.kid td:first-child { box-shadow: inset 6px 0 0 #cfd6e2; }
/* 編集している月の列 */
.gtbl th.colon { background: #c9a227; }
.gtbl td.colon { background-color: rgba(201,162,39,.16); }
.gtbl td.colon input { border-color: #c9a227; }
.gtbl td, .gtbl th { vertical-align: middle; }
input[data-numx] { text-align: right; font-variant-numeric: tabular-nums; }
.xsheet td.ro.c { padding: 4px 2px; font-size: 12px; word-break: keep-all; }

.xsheet td.rulec { position: relative; }
.xsheet td.rulec input { padding-right: 22px; }
.xsheet td.rulec button { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: 0; background: var(--brand-soft); color: var(--brand-2); border-radius: 5px; font-size: 10px; padding: 2px 5px; cursor: pointer; }

/* 並べ替えのつまみ（⠿）。押したまま上下に動かす・スマホは長押し（2026-10-21） */
.grip { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; color: var(--muted); font-size: 16px; padding: 2px 6px; display: inline-block; line-height: 1; }
.grip:active { cursor: grabbing; }
.dragging { opacity: .85; box-shadow: 0 8px 24px rgba(22,32,58,.25); background: var(--gold-soft) !important; position: relative; z-index: 5; }
body.sorting, body.sorting * { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.sort-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-top: 1px solid var(--line); background: var(--card); }
/* 単位・評価の向き（2026-10-21） */
.xsheet td.ud { font-size: 11.5px; }
.xsheet td.ud select { border: 0; width: 100%; font-size: 11.5px; background: transparent; padding: 4px 2px; box-shadow: none; min-height: 0; }
.xsheet td.ud.asc { color: var(--ok); }
.xsheet td.ud.desc { color: var(--danger); }
.xsheet td.ro small.pc { display: block; font-size: 10px; color: #8a6a12; font-weight: 400; }
.xsheet td.ud select.lkm { font-size: 10.5px; color: #8a6a12; border-top: 1px dashed var(--line); }
/* 段階のマス：数字だけ入れ、単位は横に自動で出す（2026-10-21） */
.xsheet td.nc { white-space: nowrap; }
.xsheet td.nc input { width: 58%; text-align: right; padding-right: 1px; }
.xsheet td.nc .nu { display: inline-block; width: 40%; text-align: left; font-size: 10px; color: var(--muted); overflow: hidden; vertical-align: middle; }
/* 段階のマスの下の小さい字（目標の何％か・目標の金額）（2026-10-21） */
.xsheet td.nc small.hn { display: block; font-size: 9.5px; color: #8a6a12; line-height: 1; margin: -5px 0 3px; min-height: 9px; }
/* 見る半期の切り替え（2026-10-21） */
.brand select.vh { display: block; margin-top: 2px; font-size: 11px; padding: 1px 4px; background: transparent; color: var(--gold); border: 1px solid rgba(255,255,255,.25); border-radius: 6px; min-height: 0; width: auto; }
.brand select.vh option { color: #16203a; }
.viewbar { margin: 0 24px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note.bad { background: var(--danger-bg); color: var(--danger); }
/* 週報：1項目1行の表（役割定義と同じ順・2026-10-21） */
.wtbl td { vertical-align: middle; font-size: 13px; }
.wtbl td.wn { min-width: 170px; }
.wtbl td.wn .crumb { display: block; color: var(--muted); font-size: 11px; }
.wtbl tr.dep1 td.wn { padding-left: 22px; }
.wtbl tr.dep2 td.wn { padding-left: 38px; }
.wtbl td.ud.asc small { color: var(--ok); }
.wtbl td.ud.desc small { color: var(--danger); }
.wtbl .winp { display: flex; align-items: center; gap: 4px; justify-content: center; }
.wtbl .winp input { width: 110px; text-align: right; }
.wtbl td.judge { min-width: 200px; font-size: 12px; }
.wtbl td .bar { margin-top: 4px; min-width: 90px; }
#hst .btn { margin-left: 4px; }
/* 月ごとの確定した数字（利益など・2026-10-23） */
.wtbl tr.mrow td { background: var(--brand-soft); }
.mtbl td { vertical-align: top; font-size: 13px; }
.mtbl input { width: 120px; text-align: right; }
.mtbl tr.msum td { background: var(--brand-soft); }
/* 見られない給与テーブル（名前だけ薄く・2026-10-23） */
.seg button.locked, .btn.locked { opacity: .35; cursor: not-allowed; }
/* この人として見る（社長・栞さん・2026-10-23） */
.note.viewas { margin: 0 0 12px; border-left: 4px solid var(--gold, #c9a227); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note.viewas .btn { margin-left: auto; }
/* 役割定義の一覧のタブ（部署・職位。2026-10-25） */
.tabrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tabrow .tablab { font-size: 12px; font-weight: 700; color: var(--muted); width: 3em; }
.seg.wrap { flex-wrap: wrap; max-width: 100%; }
