/* dashboard.css — 白背景・シンプル・Exgrowthグリーン */
:root {
  --green: #00532f;
  --green-mid: #318c46;
  --green-soft: #d8e394;
  --line: #e3e6e3;
  --ink: #1a1a1a;
  --muted: #6b716c;
  --bg: #f6f8f6;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.title { display: flex; align-items: baseline; gap: 10px; }
.title h1 { font-size: 20px; margin: 0; color: var(--green); }
.title span { font-size: 13px; color: var(--muted); }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn {
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--green-mid); box-shadow: 0 3px 10px rgba(0, 83, 47, .18); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--green); border-color: var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.btn.ghost:hover { background: #f4f8f5; border-color: var(--green-mid); color: var(--green); }
.btn.danger { background: #fff; color: #c0392b; border-color: #e2b8b2; box-shadow: none; }
.btn.danger:hover { background: #fbecea; }

select {
  font-size: 13px;
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%236b716c' stroke-width='1.5'><path d='M1 1l4 4 4-4'/></svg>") no-repeat right 11px center;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s, box-shadow .15s;
}
select:hover { border-color: var(--green-mid); }
select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(49, 140, 70, .15); }

/* ---- SaaS型レイアウト（左メニュー＋右コンテンツ）---- */
.app { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  --sb-bg: #14201a; --sb-bg-hover: #1e2e25; --sb-line: #27362d; --sb-text: #e7ece8; --sb-muted: #8fa397;
  width: 224px; flex-shrink: 0; background: var(--sb-bg); border-right: 1px solid var(--sb-line);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  font-size: 15px; font-weight: 600; color: #fff; padding: 4px 6px 16px;
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  border: none; background: none; cursor: pointer; font-family: inherit; text-align: left;
}
.brand:hover { opacity: .8; }
.brand-badge {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  background: var(--green-mid); color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand span { font-size: 11px; color: var(--sb-muted); font-weight: 500; }
#new-meeting-link { width: 100%; justify-content: center; box-sizing: border-box; margin-bottom: 10px; text-decoration: none; }
.side-group-label { font-size: 11px; font-weight: 600; color: var(--sb-muted); padding: 12px 12px 4px; letter-spacing: .03em; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  padding: 9px 12px; border: none; background: none; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--sb-text); cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sb-bg-hover); }
.nav-item.active { background: var(--sb-bg-hover); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--green-mid); }
.ni-ico { display: flex; align-items: center; justify-content: center; color: var(--sb-muted); flex-shrink: 0; }
.ni-ico svg { width: 16px; height: 16px; display: block; }
.nav-item.active .ni-ico, .nav-item:hover .ni-ico { color: #fff; }
.side-foot { margin-top: auto; }
.side-foot .btn { width: 100%; justify-content: center; gap: 8px; }
.side-foot .btn.ghost { background: transparent; color: var(--sb-text); border-color: var(--sb-line); }
.side-foot .btn.ghost .ni-ico { color: var(--sb-muted); }
.side-foot .btn.ghost:hover { background: var(--sb-bg-hover); border-color: var(--sb-muted); color: #fff; }
.content { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.topbar .filter-bar { flex: 1; margin-bottom: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.today-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: none; border-bottom: 1px solid var(--line); }
  .brand { padding: 4px 8px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; }
  .side-foot .btn { width: auto; }
}

main, .empty { max-width: 1080px; margin: 0 auto; padding: 22px 28px 60px; }

/* 空状態 */
.empty { text-align: center; padding-top: 80px; }
.empty-icon { font-size: 46px; }
.empty h2 { margin: 12px 0 6px; }
.empty p { color: var(--muted); line-height: 1.7; margin-bottom: 18px; }

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: box-shadow .2s ease, transform .2s ease;
}
.kpi:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 500; color: var(--green); line-height: 1; }
.kpi-value em { font-size: 15px; font-weight: 500; font-style: normal; margin-left: 2px; }

/* カード行 */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
}
.card h3 { font-size: 14px; margin: 0 0 14px; color: var(--green); }
.card h4.sub-h { font-size: 12px; color: var(--muted); margin: 18px 0 12px; font-weight: 500; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.eds-scope-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.eds-scope-label select { font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }

/* 横棒チャート */
.barchart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 42px; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg); border-radius: 999px; height: 16px; overflow: hidden; }
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-mid), var(--green));
  border-radius: 999px;
  min-width: 2px;
  transition: width .4s ease;
}
.bar-val { font-size: 12px; color: var(--muted); text-align: right; }

/* 種別の2系統色分け */
.barchart.split .bar-fill.shinki { background: var(--green); }
.barchart.split .bar-fill.kizon { background: var(--green-mid); }

.empty-chart { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* テーブル */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--bg); }
.table-wrap tbody tr:hover td { background: #f4f8f5; }
.table-wrap tbody td:first-child { font-weight: 500; }
td.num, th.num { text-align: right; }
.table-wrap tbody tr.row-click, .table-wrap tbody tr.cust-row { cursor: pointer; }

/* ---- 顧客タブ（会社・担当者検索） ---- */
.cust-search-input { width: 100%; box-sizing: border-box; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.score-pill {
  display: inline-block;
  min-width: 38px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  color: #fff;
  background: var(--green-mid);
}

.total-row td { border-top: 2px solid var(--line); background: var(--bg); }

.missed-total { font-size: 13px; color: var(--muted); }
.missed-total b { color: #c0392b; font-size: 16px; }
.missed-list { display: flex; flex-direction: column; gap: 8px; }
.missed-chip { font-size: 13px; background: #fbecea; color: #c0392b; border-radius: 999px; padding: 6px 12px; }
.missed-none { font-size: 13px; color: var(--muted); }
.missed-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fbecea; border-radius: 8px; padding: 10px 14px;
}
.missed-item-time { font-size: 12px; color: #c0392b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.missed-item-title { font-size: 14px; font-weight: 500; color: var(--ink); flex: 1; min-width: 120px; }
.missed-item-rep { font-size: 12px; color: var(--muted); }
.missed-item-fill { font-size: 12px; padding: 4px 10px; }
.missed-item-cal { font-size: 12px; padding: 4px 10px; }
.missed-item-cal-results { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.missed-cal-pick { font-size: 12px; padding: 4px 10px; }
.missed-cal-best { border-color: #c9a44a; font-weight: 500; }
#missed-card { border: 1px solid #f0c4bd; }

.insights { margin-top: 14px; padding: 12px 14px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
.insight-title { font-size: 13px; font-weight: 500; color: var(--green); margin-bottom: 8px; }
.insight-list { margin: 0; padding-left: 18px; }
.insight-list li { font-size: 13px; line-height: 1.8; color: var(--ink); }
.insight-empty { font-size: 13px; color: var(--muted); }

/* AI議事録解析カード */
.ai-settings { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.ai-field { display: block; margin-bottom: 10px; }
.ai-field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ai-field input, .ai-field select, .ai-field textarea {
  width: 100%; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-family: inherit;
}
.ai-field textarea { resize: vertical; }
.ai-field input:focus, .ai-field select:focus, .ai-field textarea:focus { outline: none; border-color: var(--green-mid); }
.ai-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.ai-check { display: flex; align-items: flex-start; gap: 8px; }
.ai-check input { width: auto; margin-top: 2px; }
.ai-check > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 0; }
.ai-result { margin-top: 14px; }

/* ---- フィルタバー ---- */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
}
.fb-icon { font-size: 13px; font-weight: 500; color: var(--green); margin-right: 2px; }
.filter-bar select { background-color: #f6f8f6; font-weight: 500; }
.filter-bar select:hover { background-color: #fff; }
.period-custom { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.period-custom input { font-size: 13px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; }


/* ---- タブ（3レンズ） ---- */
.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 2px solid var(--line); }
.tab-btn { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; font-family: inherit; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-label { font-size: 13px; color: var(--muted); margin: 4px 0 8px; font-weight: 500; }
.kpi-grid.quality { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }

/* ---- 案件カンバン ---- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.kb-col { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 160px; }
.kb-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.kb-cnt { color: var(--muted); font-weight: 500; }
.kb-body { display: grid; gap: 6px; }
.kb-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.kb-card:hover { box-shadow: 0 4px 12px rgba(16,24,40,.1); border-color: var(--green-mid); }
.kb-co { font-size: 13px; font-weight: 500; margin-bottom: 8px; line-height: 1.3; color: var(--ink); }
.kb-mid { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.kb-badge { font-size: 11px; font-weight: 500; color: #fff; background: var(--green-mid); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.kb-amt { font-size: 12px; font-weight: 500; color: var(--green); }
.kb-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.kb-foot-i { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.kb-score { color: var(--green); font-weight: 500; }
.kb-empty { color: var(--muted); font-size: 11px; text-align: center; padding: 10px; border: 1px dashed var(--line); border-radius: 6px; }
.kb-card { cursor: grab; }
.kb-card.dragging { opacity: .45; }
.kb-col.kb-over { outline: 2px dashed var(--green-mid); outline-offset: -2px; background: #f0f7f2; }

/* ---- ファネル ---- */
.funnel { display: grid; gap: 8px; }
.fn-row { display: flex; align-items: center; gap: 10px; }
.fn-label { width: 92px; font-size: 12px; color: var(--ink); flex-shrink: 0; }
.fn-track { flex: 1; display: flex; justify-content: center; }
.fn-bar { background: linear-gradient(90deg, #00532F, #318C46); color: #fff; font-size: 12px; font-weight: 500; text-align: center; padding: 7px 10px; border-radius: 6px; white-space: nowrap; }

/* ---- ドーナツ円グラフ ---- */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 160px; height: 160px; flex-shrink: 0; }
.dn-val { font-size: 26px; font-weight: 500; fill: var(--green); }
.dn-lab { font-size: 11px; fill: var(--muted); }
.dn-legend { display: grid; gap: 8px; }
.dn-leg { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.dn-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---- 担当別レーダー ---- */
.radar-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.radar-svg { flex-shrink: 0; width: 320px; max-width: 100%; }
.radar-legend { display: grid; gap: 8px; align-content: start; }
.radar-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rtab { font-size: 12px; font-weight: 500; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; font-family: inherit; transition: background .15s, color .15s, border-color .15s; }
.rtab:hover { border-color: var(--green-mid); }
.rtab.active { background: var(--green); color: #fff; border-color: var(--green); }
.leg-btn { border: none; background: none; cursor: pointer; font-family: inherit; text-align: left; padding: 0; }
.leg-btn:hover { color: var(--green); }
.radar-weak { font-size: 12px; color: #8B2332; font-weight: 500; margin-top: 4px; }

/* ---- 案件詳細ドロワー ---- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer.hidden { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .35); opacity: 0; transition: opacity .2s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(480px, 92vw); background: #fff; box-shadow: -8px 0 30px rgba(16, 24, 40, .18); transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; padding: 22px 24px; }
.drawer.wide .drawer-panel { width: min(840px, 96vw); }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.drawer-close:hover { color: var(--ink); }
.st-pill { font-size: 11px; font-weight: 500; border-radius: 999px; padding: 2px 9px; color: #fff; display: inline-block; }
.st-open { background: var(--green-mid); }
.st-won { background: var(--green); }
.st-lost { background: #8B2332; }
.dd-head h2 { font-size: 18px; color: var(--ink); margin: 0 0 14px; padding-right: 20px; }
.dd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 18px; }
.dd-fact { display: flex; flex-direction: column; gap: 2px; }
.dd-k { font-size: 11px; color: var(--muted); }
.dd-v { font-size: 14px; color: var(--ink); font-weight: 500; }
.dd-block { margin-bottom: 18px; }
.dd-block h4 { font-size: 13px; color: var(--green); margin: 0 0 8px; }
.dd-p { font-size: 13px; line-height: 1.6; margin: 0 0 4px; color: var(--ink); }
.dd-p.dd-lost { color: #8B2332; font-weight: 500; }
.dd-timeline { display: grid; gap: 10px; }
.dd-tp { border: 1px solid var(--line); border-left: 3px solid var(--green-mid); border-radius: 8px; padding: 10px 12px; }
.dd-tp-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.dd-tp-date { font-size: 12px; font-weight: 500; color: var(--ink); }
.dd-tp-tag { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 8px; }
.dd-tp-line { font-size: 12px; color: var(--ink); line-height: 1.6; }
.dd-tp-line.dd-lost { color: #8B2332; }
.deal-row, .rec-row { cursor: pointer; }
.dd-tp-click { cursor: pointer; }
.dd-tp-click:hover { border-color: var(--green-mid); background: #f4f8f5; }
.dd-edit { margin-bottom: 16px; }
.dd-edit .ai-field { margin-bottom: 10px; }
.dd-edit input, .dd-edit select, .dd-edit textarea { width: 100%; box-sizing: border-box; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-family: inherit; }
.dd-edit-actions { display: flex; gap: 8px; }

/* ---- ドリルダウン（クリック可能なグラフ/件数）---- */
.bar-row.clickable, .fn-row.clickable, .rev-row, .kpi.clickable, .row-click { cursor: pointer; }
.row-click:hover td { background: #f4f8f5; }
.bar-row.clickable:hover .bar-label, .fn-row.clickable:hover .fn-label { color: var(--green); font-weight: 500; }
.fn-row.clickable:hover .fn-bar { filter: brightness(1.08); }
.kpi.clickable:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .1); border-color: var(--green-mid); }
.dn-leg.clickable { cursor: pointer; border: none; background: none; font-family: inherit; text-align: left; padding: 0; font-size: 13px; color: var(--ink); }
.dn-leg.clickable:hover { color: var(--green); }
.pipe-kpi.clickable { cursor: pointer; transition: box-shadow .15s, transform .1s; }
.pipe-kpi.clickable:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, .1); transform: translateY(-1px); }

/* ---- コンボチャート（月次推移）---- */
.combo-wrap { width: 100%; }
.combo { width: 100%; height: auto; display: block; }
.cc-legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.cc-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.cc-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cc-dot.cc-line { width: 16px; height: 3px; border-radius: 2px; }
.combo-click .cc-bar { cursor: pointer; transition: opacity .12s, filter .12s; }
.combo-click .cc-bar:hover { opacity: .85; filter: brightness(1.18) drop-shadow(0 0 3px rgba(0,83,47,.4)); }

/* ---- 目標達成率バー ---- */
.targets { display: grid; gap: 16px; }
.tgt-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.tgt-num { color: var(--muted); font-weight: 500; }
.tgt-num b { color: var(--green); font-weight: 500; }
.tgt-num b.tgt-done { color: var(--green-mid); }
.tgt-track { background: var(--bg); border-radius: 999px; height: 14px; overflow: hidden; }
.tgt-fill { height: 100%; background: linear-gradient(90deg, var(--green-mid), var(--green)); border-radius: 999px; transition: width .4s ease; }
.tgt-fill-done { background: var(--green); }

/* ---- 案件パイプライン ---- */
.pipe-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.pipe-kpi { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: center; }
.pk-l { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pk-v { display: block; font-size: 18px; font-weight: 500; color: var(--green); }
#pipe-dim { font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
tr.total-row td { font-weight: 500; border-top: 2px solid var(--line); background: var(--bg); }
@media (max-width: 760px) { .pipe-kpis { grid-template-columns: repeat(3, 1fr); } }

/* ---- 管理者一覧 ---- */
#admin-list { display: grid; gap: 8px; margin: 10px 0; }
.admin-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--bg); font-size: 13px; }

/* ---- 項目設定エディタ ---- */
#fc-list { display: grid; gap: 12px; margin: 12px 0; }
.fc-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.fc-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.fc-grid.fc-flags { grid-template-columns: auto auto 1fr auto; align-items: end; }
.fc-f { display: block; }
.fc-f > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.fc-f input, .fc-f select { width: 100%; box-sizing: border-box; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.fc-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink); }
.fc-chk input { width: auto; }
.fc-note { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.fc-del { padding: 7px 12px; font-size: 12px; }
.fc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
#fc-status { margin-top: 8px; }
.ai-result table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ai-result th, .ai-result td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ai-result th { color: var(--muted); font-weight: 500; font-size: 12px; }
#eds-rep-detail { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.rep-summary { background: #fafbfa; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 10px 0 18px; }
.gen-status { margin-top: 8px; }
.eds-popup {
  position: fixed; z-index: 9999; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.16); max-width: 300px; font-size: 12px;
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.eds-popup.show { opacity: 1; transform: translateY(0); }
.eds-popup-title { font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.eds-popup-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-top: 1px dashed var(--line); }
.eds-popup-row:first-of-type { border-top: none; }
.eds-popup-date { color: var(--muted); flex: 0 0 auto; }
.eds-popup-company { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eds-popup-score { flex: 0 0 auto; font-weight: 500; }
.eds-popup-empty { color: var(--muted); }
.heat.hoverable, .bar-row.hoverable { cursor: pointer; }
.radar-pt, .radar-poly { cursor: pointer; }
.radar-poly { transition: stroke-width .1s; }
.radar-poly.radar-hover { stroke-width: 4; }
.ai-status { font-size: 13px; margin: 0 0 10px; }
.ai-status.ok { color: var(--green); }
.ai-status.err { color: #c0392b; }
.ai-status.loading { color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.ai-spinner {
  display: inline-block; width: 13px; height: 13px; flex: 0 0 auto;
  border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%;
  animation: ai-spin .7s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-tag { font-size: 11px; color: var(--green-mid); display: block; }
.ai-result h4.sub-h { font-size: 12px; color: var(--muted); margin: 16px 0 8px; font-weight: 500; }
.ai-result ul { margin: 0; padding-left: 18px; }
.ai-result li { font-size: 13px; line-height: 1.7; }
.eds-issue { font-size: 13px; color: #8B2332; margin: 0; }
.eds-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; flex-wrap: wrap; }
.eds-total { font-size: 30px; font-weight: 500; color: var(--green); line-height: 1; }
.eds-total small { font-size: 14px; font-weight: 500; color: var(--muted); }
.eds-overall { font-size: 13px; color: var(--ink); flex: 1 1 240px; }
/* ランクバッジ */
.eds-rank, .eds-pill { display: inline-block; font-weight: 500; color: #fff; border-radius: 8px; text-align: center; }
.eds-rank { font-size: 22px; width: 44px; height: 44px; line-height: 44px; }
.eds-pill { font-size: 12px; min-width: 22px; padding: 1px 6px; border-radius: 6px; }
.eds-S { background: #B8860B; } /* ゴールド */
.eds-A { background: var(--green); }
.eds-B { background: var(--green-mid); }
.eds-C { background: #8B2332; }

/* EDSヒートマップ */
.heatmap { width: 100%; border-collapse: collapse; font-size: 13px; }
.heatmap th, .heatmap td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.heatmap th.num, .heatmap td.num { text-align: center; }
.heatmap td.heat { font-weight: 500; } /* 文字色はJS側でバンドごとに指定（背景の濃さに応じて可読性を確保） */

/* はみ出し対策：AI解析・レポートのテーブルは折り返す */
.ai-result table th, .ai-result table td { white-space: normal; vertical-align: top; }

/* 商談レポート（別タブ） */
.report { max-width: 960px; margin: 0 auto; padding: 22px 28px 60px; }
.report-head h2 { margin: 0 0 4px; font-size: 20px; color: var(--green); }
.report-meta { font-size: 13px; color: var(--muted); line-height: 1.7; }
.report-h { font-size: 14px; color: var(--green); margin: 18px 0 8px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: normal; }
.report-table th.num, .report-table td.num { text-align: center; white-space: nowrap; }
.report-table.item-table { table-layout: fixed; }
.report-table.item-table th:nth-child(1), .report-table.item-table td:nth-child(1) { width: 20%; }
.report-table.item-table th:nth-child(2), .report-table.item-table td:nth-child(2) { width: 7%; }
.report-table.item-table th:nth-child(3), .report-table.item-table td:nth-child(3) { width: 45%; }
.report-table.item-table th:nth-child(4), .report-table.item-table td:nth-child(4) { width: 28%; }
.report ul { margin: 0; padding-left: 18px; }
.report li { font-size: 13px; line-height: 1.8; }
.eds-link { text-decoration: none; color: inherit; }
.eds-link:hover { text-decoration: underline; }
@media print { .dash-header .controls { display: none; } }

/* EDSレーダー / 凡例 */
.radar-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
#eds-radar { flex: 0 0 380px; max-width: 100%; }
.radar-legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; text-align: left; }
.legend-item:hover { border-color: var(--green-mid); }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; flex: 0 0 auto; }
.legend-name { font-weight: 500; }
.legend-meta { color: var(--muted); font-size: 12px; }
.report-ul { margin: 0; padding-left: 18px; }
.report-ul li { font-size: 13px; line-height: 1.8; }

/* 今日の日付・期間キャプション */
.today-label { font-size: 12px; color: var(--muted); margin-left: 4px; }
.period-caption { font-size: 13px; color: var(--green); font-weight: 500; margin-bottom: 14px; }

/* 営業担当別ファネル（特筆カード） */
.card.feature { border: 1px solid var(--line); }
.card.feature .card-head h3 { font-size: 14px; }
.feature-note { font-size: 12px; color: var(--muted); }

/* 営業担当別ファネルは文字を大きく見やすく */
#rep-funnel-table { font-size: 16px; }
#rep-funnel-table th { font-size: 13px; padding: 12px 12px; }
#rep-funnel-table td { padding: 14px 12px; }
#rep-funnel-table .score-pill { font-size: 15px; min-width: 44px; }

.danger-zone { margin-top: 16px; text-align: right; }

.hidden { display: none !important; }

@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
}
