/* 追加要件で新しく必要になった分だけを書く。
 * 既存 6 ファイル（base/tables/modals/app/issues/settings）は書き換えない。
 * 配色は base.css の :root カスタムプロパティをそのまま使い、新しい色を足さない。
 * スマホファースト。ブレークポイントは既存に合わせて 768 / 992 / 1200。
 */

/* ===== ページ土台 =====
   既存は #page-wbs 等の ID ごとに padding と overflow を指定している。
   モックは #pageRoot 1 枚へ描画するので同じ扱いを与える。 */
#pageRoot { padding: 0; overflow: visible; }

/* ===== サイドバー ===== */
.neo-nav-group {
  padding: 14px 16px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  color: rgba(255, 255, 255, .38);
}
.sidebar-nav a.nav-item { text-decoration: none; }
.sidebar-nav a.nav-item:hover { text-decoration: none; }

/* ロゴ行にモック表示を同居させ、サイドバー下部の余白を項目に回す */
.sidebar-logo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.neo-logo-text { min-width: 0; }
.neo-mock-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(251, 191, 36, .16);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== 共通ヘッダーのプロジェクト切替（v1.2 25.1） ===== */
.neo-project-switch { display: flex; align-items: center; gap: 6px; order: 3; width: 100%; }
.neo-project-switch-label { font-size: 10px; color: var(--c-subtle); white-space: nowrap; }
.neo-project-select {
  height: 30px;
  min-width: 0;
  flex: 1;
  padding: 0 8px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  background: #fff;
  color: var(--c-dark);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.neo-project-select:focus { border-color: var(--c-blue); }

/* ===== 通知ベル ===== */
.neo-topbar-bell {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  background: #fff;
  color: var(--c-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.neo-topbar-bell:hover { color: var(--c-blue); border-color: var(--c-blue); }
.neo-bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--c-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ===== 画面共通の見出しと操作列 ===== */
.neo-page-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.neo-page-head-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.neo-page-title { font-size: 15px; font-weight: 700; color: var(--c-dark); }
.neo-page-desc { font-size: 11px; color: var(--c-muted); line-height: 1.7; }
.neo-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.neo-note {
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--c-bg2);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 11px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.neo-note-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.neo-section { margin-bottom: 20px; }
.neo-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.neo-section-count { font-size: 11px; font-weight: 500; color: var(--c-subtle); }

/* ===== 統計カード追記 ===== */
.neo-stat-sub { font-size: 10px; color: var(--c-subtle); margin-top: 3px; }
/* 遅延・未解決などの警告値。既存 .stat-val-emphasis（緑＝良い値）とは用途が逆。 */
.stat-val.neo-stat-alert { color: var(--c-danger2); }
/* 既存は #page-wbs 等の ID で一覧側の数値を小さくしている。#pageRoot にも同じ扱いを与える。 */
#pageRoot .stat-val { min-width: 44px; font-size: 16px; line-height: 1.1; }
/*
 * 担当分（.stat-mine）は全体の値（.stat-val）と同じ行に並べる。ラベル行の直下に
 * この行を置き、値どうしを横に並べる（2026-09-03、依頼者指摘により縦積みから変更）。
 * .stat-mine-val は #pageRoot .stat-val（16px）よりわずかに大きい程度に留める
 * （全体の値より目立ちすぎないように）。
 */
.stat-val-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#pageRoot .stat-mine-val { font-size: 17px; }
.stat-card.is-clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat-card.is-clickable:hover { border-color: var(--c-blue); }
.stat-card.is-active { border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .1); }

/* 進捗率のクイック選択ボタン（0/20/40/60/80/100%）。入力欄の直下に横並びで置く。 */
.neo-progress-presets { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 14px; }

/* ===== ツールバー ===== */
.neo-toolbar { align-items: center; }

/* ===== 監査ログ：期間指定カード =====
   .card は表本体を敷き詰める前提で padding:0 + overflow:hidden（角丸で
   はみ出しを切る）。ここはフォームを直接載せるため、無指定だとラベル・
   入力欄・ボタンがカードの角丸に隠れて見切れ、直後の .toolbar とも
   すき間ゼロで接する（2026-08-31 実ブラウザで確認・発見）。 */
.neo-audit-range { padding: 16px; margin-bottom: 12px; }

/* ===== ページング ===== */
.neo-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 0;
  font-size: 11px;
  color: var(--c-muted);
}

/* 監査ログのカーソルページング（前へ/次へ）。専用スタイルが無く、
   直前の .card（一覧の表）とすき間ゼロで接し、ボタン同士も密着していた。
   既存の .neo-pager と同じ考え方（上に余白、ボタン間にすき間）で揃える。 */
.neo-cursor-pager { display: flex; align-items: center; gap: 8px; padding: 10px 2px 0; }
.neo-pager-info { flex: 1; min-width: 120px; }
.neo-pager-btns { display: flex; align-items: center; gap: 4px; }
.neo-pager-cur { padding: 0 6px; font-variant-numeric: tabular-nums; }
.neo-pager-per {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  color: var(--c-dark);
}
.btn.sm { height: 26px; padding: 0 9px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ===== 進捗バー ===== */
.neo-progress {
  position: relative;
  height: 16px;
  min-width: 72px;
  border-radius: 8px;
  background: var(--c-bg);
  overflow: hidden;
}
.neo-progress-fill { height: 100%; background: var(--c-blue); opacity: .85; }
.neo-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--c-dark);
  font-variant-numeric: tabular-nums;
  /* 塗りの境界に数値が重なっても読めるようにする */
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.neo-progress-null { color: var(--c-subtle); }

/* ===== アバター ===== */
.neo-av-inline {
  width: 22px;
  height: 22px;
  font-size: 10px;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 5px;
}

/* ===== 状態表示 ===== */
.neo-loading { padding: 40px; text-align: center; color: var(--c-subtle); font-size: 12px; }
.neo-error-box {
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--c-danger2);
  font-size: 12px;
}
.neo-error-title { font-weight: 600; margin-bottom: 4px; }
.neo-error-list { margin: 6px 0 0 18px; font-size: 11px; }
.neo-error-meta { margin-top: 6px; font-size: 10px; color: var(--c-muted); }

/* ===== 版の競合（412）表示 =====
   利用者の入力ミスではないので、赤ではなく .neo-note-warn と同系色にする。 */
.neo-conflict-box {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.neo-conflict-meta { font-size: 11px; margin-bottom: 8px; }
.neo-conflict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 8px;
}
.neo-conflict-table th, .neo-conflict-table td {
  padding: 4px 8px;
  border: 1px solid #fde68a;
  text-align: left;
  vertical-align: top;
}
.neo-conflict-table th { background: #fef3c7; font-weight: 600; }
.neo-conflict-note { font-size: 11px; }

/* ===== メンテナンス表示（423 緊急停止・復元ロック） =====
   エラーではなく「一時的に止まっている」状態なので、赤ではなく落ち着いた色にする。
   利用者の操作ミスではないことを見た目でも伝える。 */
.neo-maintenance {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
}
.neo-maintenance-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fef3c7;
  color: #b45309;
}
.neo-maintenance-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.neo-maintenance-text { font-size: 12px; line-height: 1.7; color: #78350f; }
.neo-maintenance-detail {
  margin-top: 8px;
  font-size: 11px;
  color: var(--c-muted);
}
.neo-maintenance .btn { margin-top: 14px; }

/* 起動時に止まっている場合。ナビ・ヘッダーごと覆う。 */
#appScreen.is-maintenance {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: #f0f2f8;
}
.neo-maintenance.is-full {
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(560px, 100%);
  padding: 40px 32px;
  background: #fff;
  border-color: var(--c-border);
  box-shadow: 0 16px 48px rgba(15, 23, 42, .12);
}
.neo-maintenance.is-full .neo-maintenance-icon { width: 56px; height: 56px; }
.neo-maintenance.is-full .neo-maintenance-title { font-size: 18px; margin-top: 6px; }

/* ===== トースト ===== */
.neo-toast-host {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.neo-toast {
  padding: 9px 18px;
  border-radius: 8px;
  background: var(--c-dark);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .3);
  opacity: 1;
  transition: opacity .35s, transform .35s;
  max-width: 90vw;
}
.neo-toast.is-out { opacity: 0; transform: translateY(10px); }
.neo-toast-success { background: var(--c-success); }
.neo-toast-error { background: var(--c-danger2); }
.neo-toast-warn { background: #b45309; }

/* ===== モーダル追記 ===== */
.modal-bg.neo-modal-open { display: flex; }
.neo-modal-body { font-size: 12px; color: var(--c-dark); line-height: 1.8; }
.neo-confirm-text { margin-bottom: 4px; }
.neo-warn-list {
  margin: 8px 0;
  padding-left: 20px;
  color: #92400e;
}
.neo-warn-list li {
  list-style: disc;
  margin: 2px 0;
}
.neo-detail-grid { display: grid; grid-template-columns: 92px 1fr; gap: 7px 12px; font-size: 12px; }
.neo-detail-grid dt { color: var(--c-muted); }
.neo-detail-grid dd { margin: 0; color: var(--c-dark); word-break: break-word; }

/* ===== ダッシュボード ===== */
.neo-dash-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.neo-dash-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.neo-dash-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.neo-dash-code { font-size: 10px; color: var(--c-subtle); letter-spacing: .4px; }
.neo-dash-name { font-size: 13px; font-weight: 700; color: var(--c-dark); }
.neo-dash-name a { color: inherit; text-decoration: none; }
.neo-dash-name a:hover { color: var(--c-primary); }
.neo-dash-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.neo-dash-metric { text-align: center; padding: 8px 4px; border-radius: 7px; background: var(--c-bg2); }
.neo-dash-metric-val { font-size: 16px; font-weight: 700; color: var(--c-dark); font-variant-numeric: tabular-nums; }
.neo-dash-metric-val.is-alert { color: var(--c-danger2); }
.neo-dash-metric-label { font-size: 10px; color: var(--c-subtle); margin-top: 2px; }

/* ===== WBS の表 =====
   既存 .wbs-col-* は「状態」列の無い 8 列前提で、合計が 100% を超える配分になっている。
   9 列のこの表では専用の幅を使う。合計 100%。 */
.neo-wbs-table { table-layout: fixed; }
.neo-wbs-table th, .neo-wbs-table td { overflow: hidden; }
/* % の合計 93% ＋ 操作列 76px でテーブル幅にちょうど収める */
.neo-wc-name { width: 32%; }
.neo-wc-phase { width: 8%; }
.neo-wc-owner { width: 10%; }
.neo-wc-date { width: 8%; }
.neo-wc-state { width: 7%; }
.neo-wc-progress { width: 10%; }
.neo-wc-deliv { width: 10%; }
.neo-wc-act { width: 76px; white-space: nowrap; text-align: center; }

/* 横に詰まる幅では最小幅を確保して横スクロールへ逃がす */
@media (max-width: 1199px) {
  .neo-wbs-table { width: max-content; min-width: 100%; }
  .neo-wc-name { width: 300px; }
  .neo-wc-phase { width: 96px; }
  .neo-wc-owner { width: 112px; }
  .neo-wc-date { width: 96px; }
  .neo-wc-state { width: 76px; }
  .neo-wc-progress { width: 104px; }
  .neo-wc-deliv { width: 130px; }
  .neo-wc-act { width: 76px; }
}

/* ===== WBS ツリー ===== */
.neo-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 3px;
  border: 0;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}
.neo-tree-toggle:hover { color: var(--c-primary); }
.neo-tree-spacer { display: inline-block; width: 16px; margin-right: 3px; }
.neo-task-name { display: inline-flex; align-items: center; min-width: 0; }
.neo-task-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.neo-row-parent > td { background: var(--c-bg2); }
tr.neo-row-parent .neo-task-name-text { font-weight: 600; }
.neo-mgmt-no { font-size: 10px; color: var(--c-subtle); font-variant-numeric: tabular-nums; }
.neo-legacy-label {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px dashed var(--c-subtle);
  color: var(--c-muted);
  font-size: 10px;
}
.neo-attachment-thumb {
  display: block;
  max-width: 80px;
  max-height: 60px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  object-fit: cover;
}
.neo-pending-mark { color: var(--c-subtle); font-size: 10px; margin-left: 4px; }

/* ===== 承認カード ===== */
.neo-approval-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.neo-approval-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 13px 15px;
}
.neo-approval-card.is-high { border-left: 3px solid var(--c-danger); }
.neo-approval-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.neo-approval-subject { font-size: 13px; font-weight: 600; color: var(--c-dark); }
.neo-approval-meta { font-size: 11px; color: var(--c-muted); margin-bottom: 10px; line-height: 1.8; }
.neo-approval-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 一覧まわりの微調整 ===== */
.neo-nowrap { white-space: nowrap; }
/* 操作ボタンが3〜4個以上並ぶ列用。.card td の nowrap+ellipsis（1行前提）だと
 * ボタンがはみ出て最後の1個が「…」で見えなくなるため、2行に折り返せるようにする
 * （全体ユーザー管理で発見。操作列にボタンが多い画面が今後増えても使い回せる）。 */
.card td.neo-action-wrap { white-space: normal; overflow: visible; text-overflow: clip; }
.neo-num { text-align: right; font-variant-numeric: tabular-nums; }
.neo-muted { color: var(--c-muted); }
.neo-subtle { color: var(--c-subtle); }
.neo-break { word-break: break-word; }
.neo-table-wrap { overflow-x: auto; }
.neo-table-wrap table { width: 100%; border-collapse: collapse; }
.neo-link { color: var(--c-primary); cursor: pointer; text-decoration: none; }
.neo-link:hover { text-decoration: underline; }

.neo-kv { display: grid; grid-template-columns: 1fr; gap: 8px; }
.neo-kv-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  font-size: 12px;
}
.neo-kv-key { color: var(--c-muted); }
.neo-kv-val { font-weight: 600; }

/* ===== 期限超過 ===== */
.neo-overdue { color: var(--c-danger2); font-weight: 600; }

/* ===== 権限チェック一覧 ===== */
.neo-perm-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }

/* ===== 通知 ===== */
tr.neo-unread > td { background: #f5f9ff; }
.neo-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-blue);
}

/* 通知設定「イベントごとの配信設定」の配信方式（即時/まとめて送信/配信なし）
   ボタン。3択なので<select>よりも現在の状態が一目で分かるボタン型にした
   （2026-09-03）。配色は .badge-blue/.badge-yellow/.badge-gray と同じ値を使う。 */
.notif-pref-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.notif-pref-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid #dbe3f0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.notif-pref-btn:hover { border-color: var(--c-subtle); color: var(--c-dark); }
.notif-pref-btn.mode-immediate.active { background: rgba(29,78,216,.08); color: #1d4ed8; border-color: #93c5fd; }
.notif-pref-btn.mode-digest.active { background: rgba(161,98,7,.08); color: #a16207; border-color: #fcd34d; }
.notif-pref-btn.mode-none.active { background: rgba(100,116,139,.08); color: var(--c-text4); border-color: #cbd5e1; }
.notif-pref-row-off td { opacity: .55; }
/* 既定のth（中央寄せ・無地）のままだと見出しが浮いて見えるため、他画面の
   テーブル同様に左寄せ・見出し帯を付ける（2026-09-03）。 */
.notif-pref-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  background: var(--c-bg2);
  border-bottom: 1px solid var(--c-border);
}
.notif-pref-table td { padding: 7px 10px; border-bottom: 1px solid var(--c-bg); vertical-align: middle; }
/* カテゴリの区切りは別テーブルに分けず同じ表のcolspan行にする。
   「イベント/配信」の列見出しが表全体で1回だけになるようにするため
   （2026-09-03、カテゴリごとに列見出しが繰り返されて見づらいという指摘）。 */
.notif-pref-cat-row td {
  background: var(--c-bg2);
  font-weight: 700;
  font-size: 12px;
  color: var(--c-dark);
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--c-border);
}

/* ===== 競合比較 ===== */
.neo-diff { display: grid; grid-template-columns: 1fr; gap: 10px; }
.neo-diff-col { border: 1px solid var(--c-border); border-radius: 8px; overflow: hidden; }
.neo-diff-head {
  padding: 7px 11px;
  background: var(--c-bg2);
  border-bottom: 1px solid var(--c-border);
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text4);
}
.neo-diff-body { padding: 11px; font-size: 12px; line-height: 1.9; }
/* 監査ログ「変更前後」の生JSON表示。無いとブラウザ既定の pre のまま
   （折り返さず横にはみ出す・既定の上下マージンが付く）になる（2026-08-31発見）。 */
.neo-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
}

/* ===== フォーム部品 ===== */
.neo-field { margin-bottom: 12px; }
.neo-field > label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  margin-bottom: 4px;
}
.neo-field input[type=text], .neo-field input[type=date], .neo-field input[type=time],
.neo-field input[type=number], .neo-field input[type=email], .neo-field select,
.neo-field textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  background: #fff;
  color: var(--c-dark);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.neo-field textarea { resize: vertical; line-height: 1.7; }
.neo-field input:focus, .neo-field select:focus, .neo-field textarea:focus { border-color: var(--c-blue); }
.neo-field input:disabled, .neo-field select:disabled { background: var(--c-bg2); color: var(--c-subtle); }
.neo-field.has-error input, .neo-field.has-error select, .neo-field.has-error textarea { border-color: var(--c-danger); }
.neo-field-hint { font-size: 10px; color: var(--c-subtle); margin-top: 3px; line-height: 1.6; }
.neo-field-error { font-size: 11px; color: var(--c-danger); margin-top: 3px; min-height: 0; }
.neo-field.has-error .neo-field-error { min-height: 16px; }
.neo-field-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.neo-checkbox { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: var(--c-dark); }
.neo-checkbox input { width: auto; }
/* 通知設定の曜日選択（月〜日）用。CSSが無いと .neo-checkbox 自身が display:flex
   （ブロック相当）のため、1行ずつ縦に7段積みになっていた（2026-08-31発見）。 */
.neo-checkbox-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
/* ボタンを横に並べる操作列の汎用クラス。CSSが無いとボタン同士がすき間ゼロで
   密着していた（監査ログの期間検索ボタンで発見。2026-08-31）。 */
.neo-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.neo-form-error:not(:empty) { margin-bottom: 12px; }
.neo-form-section {
  margin: 16px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-dark);
}
.neo-form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ===== ゲージ ===== */
.neo-gauge { text-align: center; padding: 6px; }
.neo-gauge-svg { width: 100%; max-width: 108px; height: auto; }
.neo-gauge-track { fill: none; stroke: var(--c-bg); stroke-width: 10; }
.neo-gauge-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.neo-gauge-text {
  text-anchor: middle;
  dominant-baseline: central;
  font-size: 18px;
  font-weight: 700;
  fill: var(--c-dark);
}
.neo-gauge-label { font-size: 11px; font-weight: 600; color: var(--c-dark); margin-top: 4px; }
.neo-gauge-sub { font-size: 10px; color: var(--c-subtle); margin-top: 2px; }
.neo-gauge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ===== 棒グラフ ===== */
.neo-bar-chart { display: flex; flex-direction: column; gap: 7px; }
.neo-bar-row { display: grid; grid-template-columns: 116px 1fr 56px; gap: 8px; align-items: center; font-size: 11px; }
.neo-bar-row.is-clickable { cursor: pointer; border-radius: 5px; padding: 2px 3px; }
.neo-bar-row.is-clickable:hover { background: var(--c-bg2); }
.neo-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text4); }
.neo-bar-track { height: 15px; background: var(--c-bg); border-radius: 8px; overflow: hidden; }
.neo-bar-fill { height: 100%; border-radius: 8px; transition: width .35s ease; }
.neo-bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ===== 円グラフ ===== */
.neo-pie-wrap { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; }
.neo-pie { width: 100%; max-width: 168px; height: auto; margin: 0 auto; display: block; }
.neo-pie .is-clickable { cursor: pointer; }
.neo-pie .is-clickable:hover { opacity: .85; }
.neo-legend { display: flex; flex-direction: column; gap: 5px; font-size: 11px; }
.neo-legend-item { display: flex; align-items: center; gap: 6px; }
.neo-legend-item.is-clickable { cursor: pointer; border-radius: 5px; padding: 2px 4px; }
.neo-legend-item.is-clickable:hover { background: var(--c-bg2); }
.neo-legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.neo-legend-pct { margin-left: auto; color: var(--c-subtle); font-variant-numeric: tabular-nums; }

.neo-chart-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.neo-chart-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 13px 15px;
}
.neo-chart-title { font-size: 12px; font-weight: 700; color: var(--c-dark); margin-bottom: 10px; }

/* ===== 列幅ドラッグ ===== */
.neo-col-resizable { position: relative; }
.neo-col-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
}
.neo-col-handle:hover { background: rgba(37, 99, 235, .22); }
table.neo-resizing { cursor: col-resize; user-select: none; }

/* ===== 並べ替え ===== */
.neo-sort-list { display: flex; flex-direction: column; gap: 6px; }
.neo-sort-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  cursor: grab;
}
.neo-sort-item.is-dragging { opacity: .45; }
.neo-sort-item.is-reserved { background: var(--c-bg2); cursor: default; }
.neo-sort-grip { color: var(--c-subtle); cursor: grab; letter-spacing: -2px; }
.neo-sort-item.is-reserved .neo-sort-grip { visibility: hidden; }
.neo-sort-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.neo-sort-actions { display: flex; gap: 5px; }

.neo-gantt-drag-tip {
  position: fixed;
  z-index: 60;
  transform: translate(-50%, -100%);
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--c-dark, #1a1a2e);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/* ===== 振り分けリスト ===== */
.neo-transfer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.neo-transfer-col { min-width: 0; }
.neo-transfer-head { font-size: 10px; color: var(--c-muted); margin-bottom: 3px; }
.neo-transfer select {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  font-size: 12px;
  padding: 4px;
  background: #fff;
}
.neo-transfer-btns { display: flex; flex-direction: column; gap: 5px; }

/* ===== 更新履歴 ===== */
.neo-history { display: flex; flex-direction: column; gap: 7px; max-height: 240px; overflow-y: auto; }
.neo-history-item {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px;
  font-size: 11px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--c-border);
}
.neo-history-when { color: var(--c-subtle); font-variant-numeric: tabular-nums; }
.neo-history-what { color: var(--c-dark); word-break: break-word; }

/* ===== 添付リスト ===== */
.neo-attach-list { display: flex; flex-direction: column; gap: 6px; }
.neo-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  font-size: 12px;
}
.neo-attach-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.neo-attach-size { color: var(--c-subtle); font-size: 10px; white-space: nowrap; }

/* ===== 依存関係リスト（タスク詳細、2026-08-20） ===== */
.neo-dep-list { display: flex; flex-direction: column; gap: 6px; }
.neo-dep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  font-size: 12px;
}
.neo-dep-arrow { color: var(--c-subtle); font-weight: 700; }
.neo-dep-row .neo-break { flex: 1; min-width: 0; }

/* ===== ガント操作 ===== */
.neo-gantt-bar-clickable { cursor: pointer; }
.neo-gantt-today { position: relative; }
.neo-gantt-today::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--c-danger);
  opacity: .55;
}

/*=====================================================*/
/* neo-presence-banner（編集中表示・残作業WBS No.4）    */
/*=====================================================*/
/* 編集を禁止するものではないので、警告色（赤）にはしない。
   「今このデータを別の人も開いている」という情報として落ち着いた色で出す。 */
.neo-presence-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  line-height: 1.6;
}

.neo-presence-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-primary);
}

/* ===== タブレット以上 ===== */
@media (min-width: 768px) {
  #pageRoot { padding: 18px 20px; overflow: auto; }

  /* サイドバーの項目が画面に収まらないときスクロールさせる。
     既存 app.css は 768px 以上で .sidebar の overflow-y を visible にしており、
     親 #appScreen が overflow:hidden なので、はみ出した項目が
     スクロールもできず見えなくなる。ロゴとフッターは固定したいので
     .sidebar 自体は hidden にして、ナビだけをスクロール領域にする。
     min-height:0 は flex item の既定 min-height:auto を打ち消すために必要。 */
  .sidebar { overflow: hidden; }
  .sidebar-nav { overflow-y: auto; min-height: 0; padding: 6px 0; }

  /* 現行テーマは 8 項目だったが新設計は 17 項目ある。既存の余白のままだと
     一般的なノート PC の高さに収まらないので、PC でだけ少し詰める。
     指で押すモバイルは既存の余白を残す。 */
  .nav-item { padding: 7px 16px; }
  .neo-nav-group { padding: 9px 16px 3px; }

  /* 暗い背景に合わせた控えめなスクロールバー */
  .sidebar-nav::-webkit-scrollbar { width: 6px; }
  .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    border-radius: 3px;
  }
  .sidebar-nav::-webkit-scrollbar-track { background: transparent; }
  .sidebar-nav { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
  .neo-project-switch { order: 0; width: auto; flex: 0 1 260px; margin-right: 14px; }
  .neo-project-select { flex: 1; min-width: 180px; }
  .neo-page-head { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .neo-page-head-text { min-width: 0; }
  .neo-dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neo-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neo-approval-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neo-perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neo-diff { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* wide:true を指定したモーダル用。CSSが1行も無く、23箇所・12ファイルの
     呼び出しすべてで通常モーダルと同じ幅（.modal の min(520px,94vw)）のまま
     効果が出ていなかった（2026-08-31発見）。既存 app.css の .modal 幅指定と
     同じ書式で、一回り広い幅を与える。 */
  .modal.neo-modal-wide { width: min(860px, 94vw); }
}

/* ===== PC 以上 ===== */
@media (min-width: 992px) {
  .neo-dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .neo-kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .neo-perm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal.neo-modal-wide { width: min(960px, 90vw); }
}

/* ===== 標準幅（v1.2 25.2: 1280px 以上を標準とする） ===== */
@media (min-width: 1200px) {
  .neo-approval-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
