/* 村上海賊 バックオフィスボード
   デザインプリセット：05_trust-corporate（CSS変数・フォントはプリセットのまま）
   シグネチャー：Source Serif の大きな「完了件数」実数（盛らない・実データのみ）
   規則：角丸は 4px まで／影は使わない／区切りは 1px の罫線 */

:root {
  --bg: #FBFBF9;
  --bg-alt: #F1F2EE;
  --ink: #1E2A38;
  --ink-soft: #5E6B78;
  --accent: #1F6E68;
  --line: #DDE0DA;
  /* しゅうへいさん待ちだけに使う警戒色。面積はごく小さく保つ */
  --alert: #A8442A;

  --sans: 'Noto Sans JP', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

/* display を指定した要素にも hidden 属性を効かせる */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
}

h1, h2 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.5; margin: 0; }

button, input { font-family: inherit; font-size: 16px; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- ログイン ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; }
.login__inner { width: 100%; max-width: 380px; }
.login__eyebrow,
.head__eyebrow {
  margin: 0; font-size: 12px; letter-spacing: 0.3em;
  color: var(--ink-soft); text-transform: uppercase;
}
.login__title { font-size: 26px; margin: 6px 0 14px; }
.login__lead { font-size: 14px; color: var(--ink-soft); margin: 0 0 28px; }
.login__form { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }
.field__label { font-size: 14px; font-weight: 500; }

input[type="password"], input[type="text"] {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: #FEFDFB; border: 1px solid var(--line); border-radius: 4px;
}
input::placeholder { color: #9AA4AE; }
input:focus { border-color: var(--accent); }

.btn {
  min-height: 48px; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--accent); border-radius: 4px;
  background: #FEFDFB; color: var(--accent);
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #18564F; border-color: #18564F; }
.btn--compact { min-height: 48px; padding: 0 16px; }
.btn--quiet {
  min-height: 40px; padding: 0 12px; font-size: 14px;
  border-color: var(--line); color: var(--ink-soft); background: transparent;
}
.btn--quiet:hover { border-color: var(--ink-soft); }
.btn:disabled { opacity: .55; cursor: default; }

.msg { margin: 0; font-size: 14px; }
.msg--error { color: var(--alert); }

/* ---------- ヘッダー ---------- */
.head { border-bottom: 1px solid var(--line); background: var(--bg); }
.head__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.head__title { font-size: 17px; margin-top: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px 96px; }

/* ---------- 月ナビと進捗（シグネチャー） ---------- */
.progress { padding: 28px 0 32px; border-bottom: 1px solid var(--line); }

.monthnav { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.monthnav__label { font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.iconbtn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  color: var(--ink-soft); cursor: pointer;
}
.iconbtn:hover:not(:disabled) { border-color: var(--line); color: var(--ink); }
.iconbtn:disabled { opacity: .3; cursor: default; }

/* 左に張り出す非対称ブロック。ページ内で大きい要素はここだけ */
.progress__figure {
  margin: 0; display: flex; align-items: baseline; gap: 2px;
  font-family: var(--serif); font-weight: 600; line-height: 1;
}
.progress__num { font-size: 64px; letter-spacing: -0.01em; }
.progress__num--total { color: var(--ink-soft); font-size: 40px; }
.progress__slash { font-size: 40px; color: var(--ink-soft); margin: 0 4px; }
.progress__unit {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  color: var(--ink-soft); margin-left: 10px;
}
.progress__rule { height: 3px; background: var(--line); margin: 18px 0 12px; }
.progress__rule span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.progress__note { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- セクション共通 ---------- */
.sect__title { font-size: 18px; margin-top: 44px; }
.sect__note { margin: 6px 0 16px; font-size: 14px; color: var(--ink-soft); }
.empty {
  margin: 0; padding: 20px; font-size: 14px; color: var(--ink-soft);
  background: var(--bg-alt); border-radius: 4px;
}

/* ---------- タスク一覧（期日を左列に固定した台帳形式） ---------- */
.tasklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tasklist li { border-bottom: 1px solid var(--line); }

.task {
  width: 100%; min-height: 64px; padding: 12px 4px;
  display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 12px;
  background: transparent; border: 0; border-radius: 4px;
  text-align: left; cursor: pointer;
  transition: background-color .15s ease;
}
.task:hover { background: var(--bg-alt); }
.task__due {
  font-size: 14px; color: var(--ink-soft); letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.task__name { font-size: 15px; line-height: 1.6; }
.task__state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.task__date { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 400; }

.task[data-status="todo"] .task__state { color: var(--ink-soft); }
.task[data-status="doing"] .task__state { color: var(--alert); }
.task[data-status="done"] .task__state { color: var(--accent); }
.task[data-status="done"] .task__name { color: var(--ink-soft); }

/* 発生月のみのタスクは薄く置く */
.task--optional .task__name,
.task--optional .task__due { color: #A6ADB4; }
.task--optional[data-status="done"] .task__name { color: var(--ink-soft); }

.task__busy { opacity: .5; }

/* ---------- ボール ---------- */
.balllist { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }

.ball {
  width: 100%; min-height: 64px; padding: 12px 14px 12px 12px;
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 12px;
  background: #FEFDFB; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 4px; text-align: left; cursor: pointer;
  transition: background-color .15s ease;
}
.ball:hover { background: var(--bg-alt); }
.ball--shuhei { border-left-color: var(--alert); background: #FDF6F3; }
.ball__owner {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent); margin-bottom: 2px;
}
.ball--shuhei .ball__owner { color: var(--alert); }
.ball__text { font-size: 15px; line-height: 1.7; }
.ball__meta { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.ball__action {
  display: inline-flex; align-items: center; gap: 4px; align-self: center;
  font-size: 14px; color: var(--ink-soft); white-space: nowrap;
}
.balllist--done .ball { border-left-color: var(--line); background: var(--bg-alt); }
.balllist--done .ball__owner { color: var(--ink-soft); }
.balllist--done .ball__text { color: var(--ink-soft); }

.donebox { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.donebox summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.donebox .balllist { margin-top: 10px; }

/* ---------- ボール追加フォーム ---------- */
.ballform {
  border: 1px solid var(--line); border-radius: 4px; padding: 14px;
  background: var(--bg-alt); display: grid; gap: 10px;
}
.ballform__owner { display: flex; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 4px; background: #FEFDFB;
  font-size: 14px; color: var(--ink-soft); cursor: pointer;
}
.chip.is-on { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.chip[data-owner="shuhei"].is-on { border-color: var(--alert); color: var(--alert); }
.ballform__row { display: flex; gap: 8px; }
.ballform__row input { flex: 1; min-width: 0; }

/* ---------- フッター・トースト ---------- */
.foot { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line); }
.foot p { margin: 0; font-size: 14px; color: var(--ink-soft); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 4px;
  background: var(--ink); color: #fff; font-size: 14px;
  z-index: 20;
}
.toast--error { background: var(--alert); }
.toast__undo {
  background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: 4px;
  color: #fff; font-size: 14px; min-height: 36px; padding: 0 12px; cursor: pointer;
}

/* ---------- 画面幅 ---------- */
@media (max-width: 420px) {
  .task { grid-template-columns: 84px 1fr; grid-template-areas: "due name" "due state"; row-gap: 2px; }
  .task__due { grid-area: due; align-self: start; padding-top: 2px; }
  .task__name { grid-area: name; }
  .task__state { grid-area: state; }
  .progress__num { font-size: 54px; }
  .ballform__row { flex-wrap: wrap; }
  .ballform__row input { flex: 1 1 100%; }
  .ballform__row .btn { width: 100%; }
}

@media (min-width: 720px) {
  .head__title { font-size: 19px; }
  .progress { padding: 44px 0 40px; }
  .progress__num { font-size: 80px; }
  .wrap { padding-bottom: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
