/* =========================================================
   CoreBoard 幹線チェック実績ダッシュボード
   提案資料の配色・レイアウトを再現
   ========================================================= */
:root {
  --brand: #005eff;
  --brand-dark: #0047c4;
  --brand-soft: #e9f2ff;
  --topbar-bg: #d5e2f5;
  --page-bg: #f4f7fc;
  --card-bg: #ffffff;
  --border: #e1e8f5;
  --border-strong: #cfdcf0;
  --text: #1c2d42;
  --text-sub: #7b8b9a;
  --text-mute: #9aa8b8;

  --green-bg: #e8fcf0;
  --green-fg: #178a48;
  --orange-bg: #fff1e6;
  --orange-fg: #b25e00;
  --red-bg: #ffebe9;
  --red-fg: #d12c1f;
  --grey-bg: #eef1f6;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(28, 45, 66, 0.06), 0 4px 12px rgba(28, 45, 66, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ────────────── トップバー ────────────── */
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-strong);
}
.topbar__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: #16324f;
  letter-spacing: 0.01em;
}
.brand__logo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  background: var(--brand);
  border-radius: 5px;
}
.brand__logo span {
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 1px;
  display: block;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #4a678f;
}
.topbar__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #5b7291;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  font-size: 15px;
}
.breadcrumb {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 24px 12px;
  color: var(--text-sub);
  font-size: 13px;
}
.breadcrumb b { color: var(--text); font-weight: 600; }
.breadcrumb .sep { margin: 0 8px; color: var(--text-mute); }

/* ────────────── レイアウト ────────────── */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card__pad { padding: 16px 18px; }
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

/* ────────────── 検索バー ────────────── */
.searchbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field > label {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}
.field select,
.field input {
  height: 38px;
  min-width: 160px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.field select:focus,
.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 94, 255, 0.12);
}
.searchbar__actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
.btn {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn--ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover:not(:disabled) { background: #f6f9ff; border-color: var(--brand); }
.btn--sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn--link {
  background: #fff;
  color: var(--brand);
  border-color: var(--brand);
}

/* 絞込行 */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-sub);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.chip.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ────────────── KPI カード ────────────── */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi--alert { border-color: #f5c6c1; }
.kpi__icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 17px;
  flex: none;
}
.kpi--alert .kpi__icon { background: var(--red-bg); color: var(--red-fg); }
.kpi__meta { display: flex; flex-direction: column; min-width: 0; }
.kpi__label { font-size: 12px; color: var(--text-sub); font-weight: 600; white-space: nowrap; }
.kpi__value { font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--text); }
.kpi--alert .kpi__value { color: var(--red-fg); }

/* ────────────── 進捗 ────────────── */
.progress {
  display: flex;
  align-items: center;
  gap: 16px;
}
.progress__label { font-weight: 700; white-space: nowrap; }
.progress__value { font-size: 22px; font-weight: 700; color: var(--brand); min-width: 74px; }
.progress__track {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: #e9ecef;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #4b93ff);
  transition: width 0.5s ease;
}

/* ────────────── 一覧テーブル ────────────── */
.table-wrap { overflow-x: auto; }
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  white-space: nowrap;
}
table.grid thead th {
  background: #3d7ce0;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  font-size: 12.5px;
  position: sticky;
  top: 0;
}
table.grid thead th:first-child { border-top-left-radius: var(--radius-sm); }
table.grid thead th:last-child { border-top-right-radius: var(--radius-sm); }
table.grid tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
table.grid tbody tr:nth-child(even) td { background: #fafcff; }
table.grid tbody tr:hover td { background: #f2f7ff; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.center, table.grid th.center { text-align: center; }

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
}
.badge--done { background: var(--green-bg); color: var(--green-fg); }
.badge--alert { background: var(--red-bg); color: var(--red-fg); }
.badge--working { background: var(--orange-bg); color: var(--orange-fg); }
.badge--not_started { background: var(--grey-bg); color: var(--text-sub); }

.result--match { color: var(--green-fg); font-weight: 600; }
.result--diff { color: var(--red-fg); font-weight: 600; }
.result--incomplete { color: var(--orange-fg); font-weight: 600; }

/* ────────────── メッセージ ────────────── */
.state {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-sub);
}
.state__icon { font-size: 30px; margin-bottom: 8px; }
.state__title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.alertbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--red-bg);
  border: 1px solid #f5c6c1;
  border-radius: var(--radius-sm);
  color: var(--red-fg);
  padding: 12px 14px;
  font-size: 13px;
  margin-top: 14px;
}
.alertbox__mark { font-weight: 700; }

/* ────────────── ダイアログ ────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 48, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 880px;
  box-shadow: 0 20px 60px rgba(16, 30, 48, 0.35);
  animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 17px; font-weight: 700; margin: 0; }
.modal__close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-sub);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.modal__close:hover { background: var(--grey-bg); }
.modal__reason {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 0;
  color: var(--red-fg);
  font-size: 13.5px;
  font-weight: 600;
}
.modal__body { padding: 16px 22px 4px; }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.info-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-row:nth-child(odd) { background: #fbfdff; }
.info-row dt { color: var(--text-sub); font-weight: 600; margin: 0; }
.info-row dd { margin: 0; color: var(--text); font-weight: 600; }

.numboxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.numbox {
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  border: 1px solid transparent;
}
.numbox__label { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.numbox__value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.numbox--blue { background: var(--brand-soft); border-color: #c9deff; }
.numbox--blue .numbox__label { color: var(--brand); }
.numbox--blue .numbox__value { color: var(--brand); }
.numbox--grey { background: #f4f6fa; border-color: var(--border); }
.numbox--grey .numbox__label { color: var(--text-sub); }
.numbox--grey .numbox__value { color: var(--text); }
.numbox--red { background: var(--red-bg); border-color: #f5c6c1; }
.numbox--red .numbox__label { color: var(--red-fg); }
.numbox--red .numbox__value { color: var(--red-fg); }

/* ────────────── フッター ────────────── */
.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 40px;
  display: flex;
  justify-content: space-between;
  color: var(--text-mute);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

/* ────────────── レスポンシブ ────────────── */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: 1fr; }
  .numboxes { grid-template-columns: 1fr; }
  .searchbar__actions { margin-left: 0; width: 100%; }
  .searchbar__actions .btn { flex: 1; justify-content: center; }
  .field select, .field input { min-width: 0; width: 100%; }
  .field { flex: 1 1 40%; }
}
