/* Launch Manager — Apple-inspired design */
* { box-sizing: border-box; }

:root {
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --card-border: rgba(0,0,0,.05);
  --card-shadow: 0 2px 12px rgba(0,0,0,.04);
  --sep: rgba(0,0,0,.08);
  --c-optin: #0a84ff;
  --c-community: #bf5af2;
  --c-front: #ff9f0a;
  --c-consult: #30b0c7;
  --c-back: #ff375f;
  --c-red: #ff3b30;
  --c-green: #30d158;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-2); font-size: 12px; }
.nowrap { white-space: nowrap; }
.empty { color: var(--text-2); padding: 20px 4px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ========== シェル / サイドバー ========== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex-shrink: 0;
  background: rgba(250,250,252,.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--sep);
  padding: 20px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-brand {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  padding: 4px 12px 16px;
}
.side-section {
  font-size: 10px; font-weight: 700; color: var(--text-2);
  letter-spacing: .12em;
  padding: 0 12px; margin: 16px 4px 6px;
}
.side-section::after {
  content: ''; display: block; height: 1px; background: var(--sep);
  margin-top: 6px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--text); font-size: 13px;
}
.side-nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.side-nav a:hover { background: #e8e8ed; text-decoration: none; }
.side-nav a.active { background: rgba(0,113,227,.1); color: var(--accent); font-weight: 600; }
.side-nav a.active svg { opacity: 1; }

main {
  flex: 1; min-width: 0;
  padding: 32px 40px 60px;
  max-width: 1240px;
}

/* ========== 見出し ========== */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.page-head h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.memo { color: var(--text-2); margin: -10px 0 18px; }

/* ========== パネル ========== */
.panel {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 22px; margin-bottom: 22px;
}
.panel h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.panel-head h2 { margin: 0; }

/* ========== テーブル ========== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.05); vertical-align: middle;
}
.tbl th { font-size: 11px; color: var(--text-2); font-weight: 600; white-space: nowrap; letter-spacing: .02em; }
.tbl tr:last-child td { border-bottom: none; }
.tbl th.num, .tbl td.num { text-align: right; }
.row-done td { color: #aeaeb2; }
.row-cancelled td { color: #aeaeb2; text-decoration: line-through; }
.total-row td { background: #fafafa; border-top: 2px solid var(--sep); }

/* ========== バッジ ========== */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 980px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge.stage-optin { background: rgba(10,132,255,.12); color: var(--c-optin); }
.badge.stage-community { background: rgba(191,90,242,.14); color: #a033e0; }
.badge.stage-front { background: rgba(255,159,10,.14); color: #c93400; }
.badge.stage-consult { background: rgba(48,176,199,.14); color: #0d7a8c; }
.badge.stage-back { background: rgba(255,55,95,.12); color: var(--c-back); }
.badge.status-planning { background: rgba(0,0,0,.06); color: var(--text-2); }
.badge.status-active { background: rgba(48,209,88,.16); color: #248a3d; }
.badge.status-completed { background: rgba(10,132,255,.12); color: var(--c-optin); }
.badge.warn { background: rgba(255,59,48,.12); color: var(--c-red); }

/* ========== ボタン ========== */
.btn {
  display: inline-block; padding: 7px 16px; border-radius: 980px;
  border: 1px solid rgba(0,0,0,.1); background: #fff; color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: #f5f5f7; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--c-red); border-color: rgba(255,59,48,.3); }
.btn.danger:hover { background: rgba(255,59,48,.06); }
.btn.small { padding: 4px 12px; font-size: 12px; }

/* ========== マイルストーンカード ========== */
.milestone-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.milestone-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 16px 20px; color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.milestone-card:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.ms-days { text-align: center; min-width: 52px; }
.ms-num { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -0.02em; }
.ms-num.small { font-size: 15px; color: var(--c-red); }
.ms-days.urgent .ms-num { color: var(--c-red); }
.ms-days.soon .ms-num { color: #c93400; }
.ms-unit { font-size: 12px; color: var(--text-2); margin-left: 2px; }
.ms-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.ms-sub { font-size: 12px; }

/* ========== ガント / タイムライン ========== */
.gantt { margin-top: 4px; }
.gantt-body { overflow: hidden; border-radius: 10px; }
.gantt-inner { will-change: transform; }
.gantt-scale { display: flex; margin-bottom: 4px; }
.gantt-tick {
  position: absolute; top: 0;
  display: flex; flex-direction: column; align-items: center;
  transform: translateX(-50%); white-space: nowrap; line-height: 1.2;
}
.gantt-tick.tick-start { transform: translateX(0); }
.gantt-tick.tick-end { transform: translateX(-100%); }
.tick-m { font-size: 9px; color: var(--text-2); height: 11px; }
.tick-d { font-size: 11px; font-weight: 700; color: var(--text); }
.tick-w { font-size: 9px; color: var(--text-2); }
.tick-w.sun { color: var(--c-red); }
.tick-w.sat { color: var(--c-optin); }
/* 今日の日付（緑枠のボックス。他の日付と同じ3行形式） */
.gantt-tick.tick-today {
  border: 1.5px solid var(--c-green); border-radius: 6px;
  background: #fff; padding: 1px 4px; z-index: 4;
}
.gantt-tick.tick-today .tick-d { color: #248a3d; }
/* PJブロック（PJ名はレーン上部に全幅表示） */
.gantt-pj { margin-bottom: 30px; padding-top: 16px; border-top: 1px solid var(--sep); }
.gantt-pj:first-of-type { padding-top: 0; border-top: none; }
.gantt.compact .gantt-pj { margin-bottom: 20px; padding-top: 12px; }
.gantt-pj-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.gantt-pj-head > a { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.gantt.compact .gantt-pj-head > a { font-size: 13px; }
.gantt-pj-body { display: flex; }
/* ステージ名列（PJ名とは別の狭い列） */
.gantt-side { width: 86px; flex-shrink: 0; padding-right: 10px; }
.gantt.compact .gantt-side { width: 72px; padding-right: 8px; }
.gantt-side-name {
  height: 37px; display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--text-2); white-space: nowrap;
}
.gantt.compact .gantt-side-name { height: 28px; font-size: 9px; }
.stage-dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.stage-dot.stage-optin { background: var(--c-optin); }
.stage-dot.stage-community { background: var(--c-community); }
.stage-dot.stage-front { background: var(--c-front); }
.stage-dot.stage-consult { background: var(--c-consult); }
.stage-dot.stage-back { background: var(--c-back); }
.gantt-track { position: relative; flex: 1; height: 36px; }
/* 集客期間バンド */
.gantt-acq {
  position: absolute; top: 5px; bottom: 5px;
  background: rgba(0,113,227,.06);
  border: 1px dashed rgba(0,113,227,.35);
  border-radius: 8px;
}
.gantt-bar {
  position: absolute; top: 9px; height: 22px; border-radius: 7px;
  font-size: 11px; font-weight: 600; color: #fff; line-height: 22px;
  padding: 0 9px; overflow: hidden; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: filter .15s;
}
.gantt-bar:hover { filter: brightness(1.08); }
.gantt-bar.stage-optin { background: var(--c-optin); }
.gantt-bar.stage-community { background: var(--c-community); }
.gantt-bar.stage-front { background: var(--c-front); }
.gantt-bar.stage-consult { background: var(--c-consult); }
.gantt-bar.stage-back { background: var(--c-back); }
.gantt-bar.current { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(255,59,48,.5); z-index: 1; }
.gantt-bar-text { overflow: hidden; text-overflow: ellipsis; }
.gantt-remain {
  background: rgba(255,255,255,.3); border-radius: 980px;
  font-size: 10px; padding: 0 7px; flex-shrink: 0;
}
/* 広告露出バー（斜線ストライプ） */
.gantt-ad {
  position: absolute; top: 42px; height: 12px; border-radius: 4px;
  font-size: 9px; line-height: 12px; color: #fff;
  padding: 0 6px 0 9px; overflow: hidden; white-space: nowrap;
  background: repeating-linear-gradient(45deg,
    rgba(110,110,115,.85) 0, rgba(110,110,115,.85) 6px,
    rgba(110,110,115,.45) 6px, rgba(110,110,115,.45) 12px);
}
.gantt-ad.stage-optin { box-shadow: inset 3px 0 0 var(--c-optin); }
.gantt-ad.stage-community { box-shadow: inset 3px 0 0 var(--c-community); }
.gantt-ad.stage-front { box-shadow: inset 3px 0 0 var(--c-front); }
.gantt-ad.stage-consult { box-shadow: inset 3px 0 0 var(--c-consult); }
.gantt-ad.stage-back { box-shadow: inset 3px 0 0 var(--c-back); }
/* 告知フラグ（ダイヤ） */
.gantt-flag {
  position: absolute; top: -4px; width: 10px; height: 10px;
  transform: translateX(-5px) rotate(45deg);
  border-radius: 2px; z-index: 3; cursor: default;
}
.gantt-flag.stage-optin { background: #0066cc; }
.gantt-flag.stage-community { background: #a033e0; }
.gantt-flag.stage-front { background: #c93400; }
.gantt-flag.stage-back { background: #d7003a; }
/* 告知開始日フラグ（白抜きダイヤ） */
.gantt-flag.ann-start { background: #fff; border: 2px solid #6e6e73; box-sizing: border-box; }
.gantt-today {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--c-green); z-index: 2; border-radius: 1px;
}
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-2); margin-top: 12px; flex-wrap: wrap; }
.legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px;
}
.legend .dot.stage-optin { background: var(--c-optin); }
.legend .dot.stage-community { background: var(--c-community); }
.legend .dot.stage-front { background: var(--c-front); }
.legend .dot.stage-consult { background: var(--c-consult); }
.legend .dot.stage-back { background: var(--c-back); }
.gantt-legend-today {
  display: inline-block; width: 2px; height: 12px; background: var(--c-green);
  margin-right: 6px; vertical-align: -2px;
}
.gantt-legend-acq {
  display: inline-block; width: 16px; height: 10px; border-radius: 3px;
  background: rgba(0,113,227,.08); border: 1px dashed rgba(0,113,227,.4);
  margin-right: 6px; vertical-align: -2px;
}
.gantt-legend-ad {
  display: inline-block; width: 16px; height: 7px; border-radius: 2px;
  background: repeating-linear-gradient(45deg, #6e6e73 0, #6e6e73 3px, #aeaeb2 3px, #aeaeb2 6px);
  margin-right: 6px; vertical-align: -1px;
}
.gantt-legend-annstart {
  display: inline-block; width: 8px; height: 8px; border-radius: 1px;
  transform: rotate(45deg); background: #fff; border: 2px solid #6e6e73;
  box-sizing: border-box;
  margin: 0 7px 0 3px; vertical-align: 0;
}

/* ========== ガントレーン（PJごとにステージ別レーン） ========== */
.gantt-lanes { flex: 1; min-width: 0; }
.gantt-lane {
  position: relative; height: 37px;
  background: rgba(0,0,0,.03);
  border-bottom: 1px solid rgba(0,0,0,.06);
  overflow: hidden;
  transition: background .12s;
}
.gantt-lane:hover { background: rgba(0,0,0,.05); }
.gantt-lane:first-child { border-radius: 10px 10px 0 0; }
.gantt-lane:last-child { border-bottom: none; border-radius: 0 0 10px 10px; }
.gantt.compact .gantt-lane { height: 28px; }
.gantt-lane .gantt-bar { top: 7px; height: 19px; line-height: 19px; font-size: 10px; }
.gantt.compact .gantt-lane .gantt-bar { top: 5px; height: 16px; line-height: 16px; font-size: 9px; padding: 0 6px; }
.gantt-lane .gantt-remain { font-size: 9px; padding: 0 5px; }
.gantt-lane .gantt-ad { top: 29px; height: 5px; font-size: 0; padding: 0; }
.gantt.compact .gantt-lane .gantt-ad { top: 22px; height: 4px; }
.gantt-lane .gantt-acq { top: 4px; bottom: 4px; border-radius: 6px; }
.gantt-lane .gantt-today { top: 0; bottom: 0; }
.gantt-lane .gantt-flag.ann-start { top: 3px; }
.gantt.compact .gantt-lane .gantt-flag.ann-start { top: 2px; }
/* 日次グリッド（1枚のグラデーションで描画） */
.gantt-daygrid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(to right,
    rgba(0,0,0,.05) 0, rgba(0,0,0,.05) 1px, transparent 1px, transparent 100%);
}
/* 開催日マーカー（丸） */
.gantt-evt {
  position: absolute; top: 50%; width: 10px; height: 10px;
  transform: translate(-5px, -5px); border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2);
  z-index: 3; cursor: default;
}
.gantt-evt.stage-optin { background: #0066cc; }
.gantt-evt.stage-community { background: #a033e0; }
.gantt-evt.stage-front { background: #c93400; }
.gantt-evt.stage-consult { background: #0d7a8c; }
.gantt-evt.stage-back { background: #d7003a; }
.gantt-legend-evt {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #c93400; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2);
  box-sizing: border-box; margin: 0 6px 0 2px; vertical-align: -1px;
}
/* タイムラインツールバー */
.tl-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.tl-sep { width: 1px; height: 18px; background: var(--sep); margin: 0 4px; }
.tl-range { margin-left: auto; font-size: 11px; }
.tl-hint { font-size: 11px; }
/* 日付スクロールバー */
.tl-scroll-row { margin: 6px 0 2px; }
.tl-scroll {
  width: 100%; height: 18px; appearance: none; -webkit-appearance: none;
  background: transparent; cursor: pointer;
}
.tl-scroll::-webkit-slider-runnable-track {
  height: 5px; background: rgba(0,0,0,.1); border-radius: 3px;
}
.tl-scroll::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); margin-top: -5.5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.tl-scroll::-moz-range-track { height: 5px; background: rgba(0,0,0,.1); border-radius: 3px; }
.tl-scroll::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; border: none;
  background: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.tl-scroll:disabled { opacity: .4; cursor: default; }
/* Chatwork設定 */
.cw-enabled .stage-toggle { margin-top: 0; }
/* 横長テーブルのスクロール */
.tbl-scroll { overflow-x: auto; }
.tbl-scroll .tbl { min-width: 900px; }

/* ステージ使用トグル（PJ編集モーダル） */
.stage-toggles { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.stage-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }

/* ========== 経路別内訳 ========== */
.stage-ch { margin-top: 10px; border-top: 1px dashed rgba(0,0,0,.08); padding-top: 8px; }
.stage-ch-title { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.ch-row { display: flex; align-items: baseline; gap: 8px; font-size: 12px; padding: 2px 0; }
.ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-nums { font-variant-numeric: tabular-nums; }
.ch-share { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.ch-pct { width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.ch-note { margin-top: 4px; font-size: 11px; }
.ch-note.warn { color: var(--c-red); }
.ch-edit-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.ch-edit-row .ch-name { flex: 1; padding: 7px 10px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; font-size: 13px; font-family: inherit; }
.ch-edit-row .ch-goal, .ch-edit-row .ch-actual {
  width: 76px; padding: 7px 10px; border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px; font-size: 13px; font-family: inherit;
}
.comm-rate { font-size: 12px; color: var(--text); }
.comm-rate strong { color: #a033e0; }
/* 開催日程エディタ */
.evt-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.evt-row .evt-date { width: 150px; padding: 7px 10px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; font-size: 13px; font-family: inherit; }
.evt-row .evt-note { flex: 1; padding: 7px 10px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; font-size: 13px; font-family: inherit; }
.report-note { margin: -10px 0 16px; }

/* ========== ログイン ========== */
body.login-mode .sidebar { display: none; }
body.login-mode main { display: flex; align-items: center; justify-content: center; max-width: 100%; }
.login-card {
  background: #fff; border: 1px solid var(--card-border); border-radius: 20px;
  box-shadow: var(--card-shadow); padding: 36px 40px; width: 360px; max-width: 92vw;
}
.login-brand { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.login-card form { margin-top: 16px; }
.login-err { color: var(--c-red); font-size: 12px; min-height: 16px; margin: 6px 0 10px; }
.login-submit { width: 100%; padding: 10px; }

/* ========== 管理者バナー（表示切替中） ========== */
.viewas-banner {
  background: rgba(255,159,10,.12); border: 1px solid rgba(255,159,10,.4);
  border-radius: 12px; padding: 9px 16px; margin-bottom: 18px;
  font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ========== マイページ ========== */
.mypage-idrow { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 8px; }
.mypage-actions { margin-top: 10px; }
.pw-form { max-width: 360px; }
.user-new-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.user-new-form input {
  padding: 8px 11px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
  font-size: 13px; font-family: inherit; width: 220px;
}
.viewas-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.05); font-size: 13px;
}
.viewas-row:last-child { border-bottom: none; }
.viewas-name { font-weight: 600; min-width: 140px; }

/* ========== ペース管理・日次ノルマ ========== */
.pace-row { margin-top: 8px; }
.pace {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 980px;
  display: inline-block;
}
.pace-ok { background: rgba(48,209,88,.16); color: #248a3d; }
.pace-warn { background: rgba(255,159,10,.16); color: #c93400; }
.pace-delay { background: rgba(255,59,48,.12); color: var(--c-red); }
.norm { margin-top: 5px; }

/* ========== 実績推移スパークライン ========== */

/* ========== 実績クイック入力 ========== */
.actual-quick { display: flex; gap: 6px; margin-top: 12px; align-items: center; }
.actual-quick input {
  width: 90px; padding: 5px 9px; border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px; font-size: 12px; font-family: inherit;
}
.actual-quick input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.18); }

/* ========== ファネル ========== */
.funnel-sub { margin: -6px 0 10px; font-size: 11px; }
.funnel-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 5px 0; }
.funnel-label { width: 96px; flex-shrink: 0; }
.funnel-track {
  flex: 1 1 0; min-width: 48px; max-width: 520px; height: 22px;
  background: rgba(0,0,0,.04); border-radius: 6px; overflow: hidden;
}
.funnel-bar { height: 100%; border-radius: 6px; transition: width .3s; }
.funnel-bar.stage-optin { background: var(--c-optin); }
.funnel-bar.stage-community { background: var(--c-community); }
.funnel-bar.stage-front { background: var(--c-front); }
.funnel-bar.stage-consult { background: var(--c-consult); }
.funnel-bar.stage-back { background: var(--c-back); }
.funnel-val { min-width: 56px; flex-shrink: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-note { display: block; font-size: 10px; color: var(--text-2); font-weight: 400; }
.funnel-conv { min-width: 48px; flex-shrink: 0; font-size: 11px; font-weight: 700; color: #248a3d; }
.funnel-conv.over { color: var(--c-optin); }

/* ========== 今日のフォーカス ========== */
.focus-panel { border-color: rgba(0,113,227,.25); background: rgba(0,113,227,.03); box-shadow: none; }
.focus-item { padding: 7px 0; border-top: 1px solid rgba(0,113,227,.1); font-size: 13px; }
.focus-item:first-of-type { border-top: none; }
.focus-item.warn { color: var(--c-red); }

/* ========== PJカード一覧 ========== */
.pj-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 14px;
}
.pj-card {
  display: block; background: #fff; border: 1px solid var(--card-border);
  border-radius: 16px; box-shadow: var(--card-shadow);
  padding: 18px 20px; color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.pj-card:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.pj-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 6px;
}
.pj-card-head strong { font-size: 15px; letter-spacing: -0.01em; }
.pj-steps { display: flex; gap: 8px; margin: 12px 0 10px; }
.pj-step {
  flex: 1; border: 1px solid rgba(0,0,0,.07); border-radius: 10px;
  padding: 6px 8px; font-size: 10px; color: var(--text-2);
}
.pj-step-name { display: block; font-weight: 700; font-size: 11px; color: var(--text); }
.pj-step.current { border-color: var(--c-red); background: rgba(255,59,48,.05); }
.pj-step.current .pj-step-name { color: var(--c-red); }
.pj-step.done { background: rgba(0,0,0,.03); }
.pj-card-foot { text-align: right; }
.pj-card-foot .rev { color: var(--text); }

/* ========== ステッパー ========== */
.stepper {
  display: flex; align-items: flex-start; margin: 4px 0 22px;
  background: #fff; border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 20px 28px;
}
.step { flex: 1; text-align: center; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e8e8ed; color: var(--text-2); font-weight: 700;
  line-height: 32px; margin: 0 auto 8px; font-size: 14px;
}
.step.current .step-dot { background: var(--c-red); color: #fff; }
.step.done .step-dot { background: var(--c-green); color: #fff; }
.step-name { font-weight: 700; font-size: 13px; }
.step-note { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.step.current .step-note { color: var(--c-red); font-weight: 600; }
.step-connector { flex: 0 0 40px; height: 2px; background: #e8e8ed; margin-top: 15px; }

/* ========== ステージカード ========== */
.stage-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stage-cards-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 4px 0 10px;
}
.stage-cards-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.stage-card {
  background: #fff; border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 18px 20px;
}
.stage-card-head { display: flex; justify-content: space-between; align-items: center; }
.stage-card h3 { margin: 0; font-size: 14px; }
.stage-dates { margin: 8px 0; font-size: 13px; }
.stage-nums { font-size: 13px; color: var(--text-2); }
.stage-nums .actual { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.stage-extra { margin-top: 6px; font-size: 12px; }

.progress {
  height: 5px; background: rgba(0,0,0,.06); border-radius: 3px;
  margin: 10px 0 4px; overflow: hidden;
}
.progress-bar { height: 100%; background: var(--c-green); border-radius: 3px; }
.progress.slim { height: 4px; }

/* ========== 成果指標 ========== */
.metrics { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.metric-card {
  border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
  padding: 12px 16px; min-width: 170px;
}
.metric-name { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.metric-val { font-size: 13px; }
.metric-val strong { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.metric-actions { margin-top: 8px; }

/* ========== モーダル ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 18px; width: 500px; max-width: 94vw;
  max-height: 90vh; overflow-y: auto; padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.modal-foot { margin-top: 18px; text-align: right; }

.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 8px 11px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
  font-size: 13px; font-family: inherit; background: #fff;
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.18);
}
.fld-row { display: flex; gap: 12px; }
.fld-row .fld { flex: 1; }
.fld-section {
  font-size: 12px; font-weight: 700; color: var(--text);
  border-top: 1px solid rgba(0,0,0,.06); padding-top: 12px; margin: 16px 0 10px;
}

.select {
  padding: 7px 11px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
  font-size: 13px; background: #fff;
}

/* ========== トースト ========== */
#lm-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: rgba(29,29,31,.92); color: #fff; padding: 11px 22px; border-radius: 980px;
  font-size: 13px; opacity: 0; transition: all .25s; pointer-events: none; z-index: 200;
}
#lm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#lm-toast.error { background: rgba(255,59,48,.95); }

/* ========== レポート（サマリーカード / 構成バー） ========== */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.stat-card {
  background: #fff; border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: var(--card-shadow); padding: 16px 20px;
}
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-sub { margin-top: 4px; }
/* PJダッシュボード */
.pj-dash { margin-bottom: 22px; }
.stat-card.good .stat-value { color: #248a3d; }
.stat-card.bad .stat-value { color: var(--c-red); }
.revbar-cell { min-width: 110px; }
.revbar {
  display: flex; height: 8px; border-radius: 4px; overflow: hidden;
  background: rgba(0,0,0,.05); max-width: 100%;
}
.revbar-front { background: var(--c-front); height: 100%; }
.revbar-back { background: var(--c-back); height: 100%; }
.report-tbl td:first-child { min-width: 150px; }
.report-tbl td, .report-tbl th { white-space: nowrap; }
.report-tbl td:first-child { white-space: normal; }

/* ========== フィルタバー ========== */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -8px 0 20px;
}
.filter-label { font-size: 12px; color: var(--text-2); }
.filter-bar input[type="date"] {
  padding: 6px 9px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px;
  font-size: 12px; font-family: inherit; background: #fff; color: var(--text);
}

/* ========== 告知開始日（ステージカード） ========== */
.stage-ann-start {
  font-size: 12px; font-weight: 600; color: var(--text);
  background: rgba(0,113,227,.06); border-radius: 8px;
  display: inline-block; padding: 3px 10px; margin: 2px 0 4px;
}

/* ========== 原稿URL ========== */
.draft-note { margin: -6px 0 12px; }
.draft-url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fld-hint { margin: -8px 0 12px; font-size: 11px; }
