/* styles/is_feedback.css
 * 第一チーム「AI日次フィードバックログ」専用スタイル（設計書 v2 §12-7）。
 * 透明化条件（§02）: 順位・達成率・赤の色分け・グラフは置かない。色は「区分」を示すだけで
 * 良し悪しの評価色ではない。共通の .is-wrap / .is-head / .is-loading / .is-empty / .is-error は
 * is_dashboard.css を使う。
 */

.isfb-basis {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #0B7E9C;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.6;
}
.isfb-basis-title { font-weight: 700; margin-bottom: 6px; }
.isfb-basis ul { margin: 0; padding-left: 18px; }
.isfb-basis li { margin: 2px 0; overflow-wrap: anywhere; }

/* メンバー横タブ（横スクロール・折り返さない） */
.isfb-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: thin;
}
.isfb-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.isfb-tab.active {
  background: #0B7E9C;
  border-color: #0B7E9C;
  color: #fff;
  font-weight: 700;
}
.isfb-me {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(11,126,156,0.12);
  color: #0B7E9C;
}
.isfb-tab.active .isfb-me { background: rgba(255,255,255,0.25); color: #fff; }

/* 日付ナビ */
.isfb-datenav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 4px;
}
.isfb-nav-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.isfb-nav-btn:disabled { opacity: 0.4; cursor: default; }
.isfb-date { font-size: 15px; font-weight: 700; text-align: center; flex: 1 1 auto; }
.isfb-datenote { font-size: 11px; color: var(--text-sub); margin-bottom: 10px; }

/* 当日カード */
.isfb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.isfb-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.isfb-card-name { font-size: 17px; font-weight: 700; }
.isfb-card-date { font-size: 12px; color: var(--text-sub); }

.isfb-block {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.isfb-block:first-child { border-top: none; }
.isfb-block-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.isfb-headline { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.isfb-text { font-size: 13px; line-height: 1.6; margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.isfb-meta { font-size: 11px; color: var(--text-sub); margin-top: 4px; }
.isfb-quote {
  margin: 6px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--border-strong);
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
/* Mgrの一言はカードの前（数字より前・§02条件4） */
.isfb-mgr {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #6b7280;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.isfb-card .isfb-mgr { border: none; border-top: 1px solid var(--border); border-radius: 0; padding: 12px 0; margin: 0; }
.isfb-dup-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.isfb-dup-list li { margin: 2px 0; }

/* 補足・Mgr一言フォーム */
.isfb-note-form {
  border-top: 1px solid var(--border);
  padding: 10px 0 0;
  font-size: 13px;
}
.isfb-mgr-form {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.isfb-note-form summary { cursor: pointer; color: #0B7E9C; font-weight: 600; }
.isfb-note-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.isfb-form-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.isfb-btn {
  border: none;
  background: #0B7E9C;
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.isfb-btn:disabled { opacity: 0.5; cursor: default; }
.isfb-form-msg { font-size: 12px; color: var(--text-sub); }

.isfb-skeleton { min-height: 120px; }

/* ダークモード */
[data-theme="dark"] .isfb-quote { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .isfb-me { background: rgba(11,126,156,0.3); color: #7dd3e8; }

/* レスポンシブ（390px で横スクロールを出さない） */
@media (max-width: 480px) {
  .isfb-card { padding: 12px; }
  .isfb-nav-btn { padding: 8px 10px; font-size: 12px; }
  .isfb-date { font-size: 14px; }
  .isfb-basis { font-size: 12px; padding: 12px; }
}

/* ============================================================================
 * 日次架電レポート（設計書 v2 §14-3「レイアウト」「色」）
 * PC は A4 縦1枚（794px）・印刷で1枚に収める。スマホ 390px で縦積み・横スクロールなし。
 * 色は「判定帯」「3KPI表」「アラート帯」の3箇所だけ（§14-3）。
 * ========================================================================== */

.isrep { --rep-ok: #1D4ED8; --rep-bad: #DC2626; --rep-warn: #D97706; --rep-none: #6b7280; --rep-gold: #B8860B; }

.isrep .is-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.isrep-print {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

/* ［日次｜週次｜月次］セグメント */
.isrep-seg { display: flex; gap: 4px; margin: 4px 0 12px; flex-wrap: wrap; }
.isrep-seg-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.isrep-seg-btn.active { background: #0B7E9C; border-color: #0B7E9C; color: #fff; font-weight: 700; }
.isrep-seg-btn.soon { color: var(--text-sub); }
.isrep-seg-btn.soon.active { color: #fff; }

.isrep-soon {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-sub);
}
.isrep-soon-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* A4 1枚のシート */
.isrep-sheet {
  max-width: 794px;
  margin: 0 auto 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  box-sizing: border-box;
}
.isrep-partial {
  border: 1px solid var(--rep-warn);
  color: var(--rep-warn);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ブロック0 ヘッダー＋判定帯 */
.isrep-head { margin-bottom: 12px; }
.isrep-head-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.isrep-head-date { font-size: 12px; color: var(--text-sub); }
.isrep-head-name { font-size: 19px; font-weight: 700; }
.isrep-head-team { font-size: 12px; color: var(--text-sub); }
.isrep-band { border-left: 6px solid var(--rep-none); border-radius: 8px; padding: 10px 14px; background: var(--bg); }
.isrep-band-label { font-size: 15px; font-weight: 700; color: var(--rep-none); }
.isrep-band-text { font-size: 13px; line-height: 1.7; margin: 4px 0 0; overflow-wrap: anywhere; }
.isrep-tone-ok.isrep-band { border-left-color: var(--rep-ok); }
.isrep-tone-ok .isrep-band-label, .isrep-band.isrep-tone-ok .isrep-band-label { color: var(--rep-ok); }
.isrep-tone-bad.isrep-band { border-left-color: var(--rep-bad); }
.isrep-band.isrep-tone-bad .isrep-band-label { color: var(--rep-bad); }
.isrep-tone-warn.isrep-band { border-left-color: var(--rep-warn); }
.isrep-band.isrep-tone-warn .isrep-band-label { color: var(--rep-warn); }

/* ブロック共通 */
.isrep-block { border-top: 1px solid var(--border); padding: 12px 0 4px; break-inside: avoid; page-break-inside: avoid; }
.isrep-block-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.isrep-block-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 700; color: var(--text-sub); flex: 0 0 auto;
}
.isrep-block-title { font-size: 14px; font-weight: 700; }
.isrep-sub { font-size: 12px; font-weight: 700; color: var(--text-sub); margin: 8px 0 2px; }
.isrep-text { font-size: 13px; line-height: 1.75; margin: 2px 0 0; overflow-wrap: anywhere; }
.isrep-muted { color: var(--text-sub); }
.isrep-facts { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin: 6px 0 0; overflow-wrap: anywhere; }
.isrep-meta { font-size: 11px; color: var(--text-sub); margin-top: 6px; }
.isrep-list { margin: 2px 0 0; padding-left: 18px; }
.isrep-list li { margin: 4px 0; }
.isrep-count { font-size: 11px; color: var(--rep-warn); font-weight: 700; }
.isrep-pos { font-size: 11px; color: var(--text-sub); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 8px; }
.isrep-axis { display: inline-block; font-size: 11px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; margin-right: 6px; color: var(--text-sub); }
.isrep-peer { font-size: 11px; border: 1px solid var(--rep-gold); color: var(--rep-gold); border-radius: 999px; padding: 1px 8px; }

/* ブロック1 3KPI表 */
.isrep-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.isrep-kpi-cell { border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.isrep-kpi-label { font-size: 11px; color: var(--text-sub); }
.isrep-kpi-value { font-size: 19px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.isrep-kpi-target { font-size: 12px; font-weight: 400; color: var(--text-sub); }
.isrep-kpi-rate { font-size: 12px; font-weight: 700; }
.isrep-kpi-cell.isrep-tone-ok { border-color: var(--rep-ok); }
.isrep-kpi-cell.isrep-tone-ok .isrep-kpi-rate { color: var(--rep-ok); }
.isrep-kpi-cell.isrep-tone-bad { border-color: var(--rep-bad); }
.isrep-kpi-cell.isrep-tone-bad .isrep-kpi-rate { color: var(--rep-bad); }
.isrep-kpi-cell.isrep-tone-none .isrep-kpi-rate { color: var(--text-sub); }

/* ブロック2 通話上位3件 */
.isrep-calls { list-style: none; margin: 4px 0 0; padding: 0; }
.isrep-call { border-top: 1px dashed var(--border); padding: 8px 0; }
.isrep-call:first-child { border-top: none; }
.isrep-call-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; color: var(--text-sub); }
.isrep-call-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--bg);
  border: 1px solid var(--border-strong); font-size: 10px; font-weight: 700; flex: 0 0 auto;
}
.isrep-call-dur { font-weight: 700; color: var(--text); }
.isrep-call-result { border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 6px; }
.isrep-call-cp { font-size: 13px; font-weight: 600; margin-top: 3px; overflow-wrap: anywhere; }
.isrep-call-point { font-size: 12px; color: var(--text-sub); margin-top: 2px; line-height: 1.6; overflow-wrap: anywhere; }

/* ブロック4 アラート（黄・赤とは別物） */
.isrep-alerts { list-style: none; margin: 4px 0 0; padding: 0; }
.isrep-alert { border-left: 4px solid var(--rep-warn); background: var(--bg); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
.isrep-alert-notice { border-left-style: dashed; }
.isrep-alert-head { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--rep-warn); font-weight: 700; }
.isrep-alert-id { border: 1px solid var(--rep-warn); border-radius: 4px; padding: 0 5px; }
.isrep-mgrline { font-size: 12px; color: var(--text-sub); margin: 6px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.isrep-mgrtag, .isrep-notetag {
  display: inline-block; font-size: 10px; font-weight: 700;
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; margin-right: 6px; color: var(--text-sub);
}

/* ブロック5 接点量（中央値との比較バー・Chart.js は使わない） */
.isrep-bars { margin-top: 6px; }
.isrep-bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px;
  gap: 6px 10px;
  align-items: center;
  margin: 6px 0;
  font-size: 12px;
}
.isrep-bar-label { grid-column: 1; grid-row: 1 / span 2; color: var(--text-sub); overflow-wrap: anywhere; }
.isrep-bar-track { grid-column: 2; height: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.isrep-bar { height: 100%; border-radius: 999px; }
.isrep-bar-mine { background: #0B7E9C; }
.isrep-bar-med { background: var(--border-strong); }
.isrep-bar-val { grid-column: 3; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ブロック6 ネクストアクション */
.isrep-block.isrep-next { border-top: 1px solid var(--border); }
.isrep-next-text { font-size: 14px; font-weight: 600; line-height: 1.75; }

/* 基準（常設・§14-5 閾値公開） */
.isrep-basis {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 12px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-sub);
}
.isrep-basis-title { font-weight: 700; margin-bottom: 3px; }
.isrep-basis ul { margin: 0 0 6px; padding-left: 16px; }
.isrep-basis li { overflow-wrap: anywhere; }
.isrep-th li { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ダークモード */
[data-theme="dark"] .isrep-band,
[data-theme="dark"] .isrep-alert { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .isrep { --rep-ok: #60A5FA; --rep-bad: #F87171; --rep-warn: #FBBF24; --rep-gold: #E3B341; }

/* スマホ（390px で横スクロールなし・縦積み） */
@media (max-width: 480px) {
  .isrep-sheet { padding: 14px 12px; border-radius: 10px; }
  .isrep-kpi-grid { grid-template-columns: 1fr; }
  .isrep-kpi-value { font-size: 17px; }
  .isrep-head-name { font-size: 17px; }
  .isrep-bar-row { grid-template-columns: 1fr; }
  .isrep-bar-label, .isrep-bar-track, .isrep-bar-val { grid-column: 1; grid-row: auto; }
  .isrep-print { padding: 7px 10px; font-size: 12px; }
  .isrep-seg-btn { padding: 7px 14px; }
}

/* 印刷（A4 1枚・§14-3「レイアウト」） */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .is-head, .isrep-seg, .isfb-tabs, .isfb-datenav, .isfb-datenote,
  .isrep-print, .isfb-note-form, .isfb-mgr-form, .isrep-partial { display: none !important; }
  .isrep-sheet {
    max-width: none;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    font-size: 10.5pt;
  }
  .isrep-block { break-inside: avoid; page-break-inside: avoid; padding: 8px 0 2px; }
  .isrep-text, .isrep-band-text { line-height: 1.55; }
  .isrep-bar-mine, .isrep-bar-med { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]::after { content: none !important; }
}

/* ===================================================================
   R2: 週次・月次レポート（§14-7 / §14-10）
   日次と同じ器（.isrep-sheet / .isrep-block）を使い、表と閾値パネルだけを足す。
   幅の広い表は必ず .isrep-tablewrap の中で横スクロールさせる（本文は横に流さない）。
   =================================================================== */
.isrep-kpi-days { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* 判定の内訳 */
.isrep-vds { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.isrep-vd {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-2, rgba(0, 0, 0, 0.03));
  font-size: 12px;
}
.isrep-vd-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.isrep-vd-share { color: var(--text-sub); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }

/* アラート集計 */
.isrep-alsums { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.isrep-alsum {
  display: grid;
  grid-template-columns: 3.2em 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.isrep-alsum:last-child { border-bottom: none; }
.isrep-alsum.zero { color: var(--text-sub); }
.isrep-alsum-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.isrep-alsum-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.isrep-note { font-size: 11px; color: var(--text-sub); line-height: 1.7; margin: 6px 0 0; }
.isrep-best { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin: 6px 0 0; }
.isrep-best a { font-weight: 700; }

/* 日別ミニ表（月次） */
.isrep-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 6px; }
.isrep-table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 12px; }
.isrep-table th, .isrep-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.isrep-table thead th { text-align: right; font-size: 11px; color: var(--text-sub); font-weight: 600; }
.isrep-table th[scope="row"], .isrep-table thead th:first-child { text-align: left; }
.isrep-table td { font-variant-numeric: tabular-nums; }
.isrep-row-missing td, .isrep-row-missing th { color: var(--text-sub); }

/* アラート閾値パネル（Mgr） */
.isrep-th-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.isrep-th-panel > summary { cursor: pointer; font-weight: 700; }
.isrep-thgrid { display: grid; gap: 10px; margin-top: 8px; }
.isrep-thgrp { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin: 0; }
.isrep-thgrp > legend { font-size: 11px; font-weight: 700; padding: 0 4px; }
.isrep-thfield { display: grid; grid-template-columns: 9em 6.5em 1fr; gap: 8px; align-items: center; padding: 3px 0; }
.isrep-thkey { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
.isrep-thinput {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 5px;
  background: var(--surface, #fff);
  color: inherit;
  font-variant-numeric: tabular-nums;
}
.isrep-thinput:disabled { opacity: 0.6; }
.isrep-thdesc { font-size: 11px; color: var(--text-sub); line-height: 1.6; }
.isfb-btn-sub { background: transparent; border: 1px solid var(--border-strong, var(--border)); color: inherit; }

/* スマホ（390px で横スクロールなし＝表だけが自分の枠内でスクロールする） */
@media (max-width: 480px) {
  .isrep-vd { grid-template-columns: 1fr auto; }
  .isrep-vd-share { grid-column: 2; }
  .isrep-alsum { grid-template-columns: 3.2em 1fr; }
  .isrep-alsum-count { grid-column: 2; text-align: right; }
  .isrep-thfield { grid-template-columns: 1fr; gap: 2px; }
  .isrep-thinput { width: 100%; max-width: 100%; }
  .isrep-table { min-width: 460px; }
}

/* 印刷（週次・月次も A4 1枚に寄せる。編集UIは出さない） */
@media print {
  .isrep-th-panel { display: none !important; }
  .isrep-tablewrap { overflow: visible; }
  .isrep-table { min-width: 0; font-size: 9pt; }
}
