@charset "utf-8";
/* ===== Base ===== */ :root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, .08);
  --good: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(59, 130, 246, .10), transparent 60%), radial-gradient(900px 500px at 80% 0%, rgba(99, 102, 241, .10), transparent 55%), var(--bg);
}
.container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 18px;
}
/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(17, 24, 39, .92);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.app-header h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .08em;
}
.app-header nav a {
  position: relative;
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
  margin-left: 16px;
}
.app-header nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #ffffff, #e5e7eb);
  transform: translateX(-50%);
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
/* ホバー時 */
.app-header nav a:hover {
  color: #fff;
}
.app-header nav a:hover::after {
  width: 100%;
}
/* アクティブ時 */
.app-header nav a.is-active {
  color: #fff;
  font-weight: 800;
}
.app-header nav a.is-active::after {
  width: 100%;
}
/* ===== Panels ===== */
section {
  background: var(--panel);
  padding: 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .06);
}
/* ===== KPI (Impact) ===== */
.kpi {
  padding: 22px 22px 18px;
  overflow: hidden;
  position: relative;
}
.kpi::before {
  /* 上部のアクセント帯（状態色はクラスで上書き） */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 10px;
  background: rgba(148, 163, 184, .35);
}
.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.kpi h2 {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: .04em;
}
.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid var(--line);
  background: #f1f5f9;
}
/* 数字を“主役”に */
.kpi-value {
  margin: 6px 0 10px;
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 900;
  letter-spacing: .02em;
}
.kpi-sub {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
/* 状態色（赤黄緑） */
.kpi--good::before {
  background: color-mix(in srgb, var(--good) 70%, white);
}
.kpi--warn::before {
  background: color-mix(in srgb, var(--warn) 70%, white);
}
.kpi--bad::before {
  background: color-mix(in srgb, var(--bad) 70%, white);
}
.kpi--good .kpi-badge {
  background: rgba(22, 163, 74, .10);
  color: #166534;
}
.kpi--warn .kpi-badge {
  background: rgba(245, 158, 11, .14);
  color: #7c4a03;
}
.kpi--bad .kpi-badge {
  background: rgba(239, 68, 68, .12);
  color: #7f1d1d;
}
/* ===== Decisions & Actions: 2カラムで“判断→行動”を並べる ===== */
.decisions, .actions {
  padding: 18px;
}
.decisions h2, .actions h2 {
  margin: 0 0 10px;
  font-size: 15px;
}
#decisionList, #actionList {
  margin: 0;
  padding-left: 18px;
  color: #111827;
  line-height: 1.85;
}
@media (min-width: 980px) {
  body.page-dashboard main.container {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 16px;
    align-items: start;
  }
  body.page-dashboard .kpi {
    grid-column: 1 / -1;
  }
  body.page-dashboard .decisions {
    grid-column: 1 / 2;
  }
  body.page-dashboard .actions {
    grid-column: 2 / 3;
  }
}
.kpi-one {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-weight: 700;
}
.kpi-gap-large {
  margin: 6px 0 4px;
  font-size: 22px;
  font-weight: 900;
  color: var(--bad);
}
.app-logo {
  margin: 0;
  font-size: 16px;
  letter-spacing: .08em;
}
.app-logo a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  transition: opacity .2s ease, transform .2s ease;
}
.app-logo a:hover {
  opacity: .85;
  transform: translateY(-1px);
}
/* ===== Jobs Risk Coloring ===== */
#jobsTable {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
#jobsTable th, #jobsTable td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
/* GOOD */
.job-good td:first-child {
  border-left: 4px solid #16a34a;
}
.job-warn td:first-child {
  border-left: 4px solid #f59e0b;
}
.job-bad td:first-child {
  border-left: 4px solid #ef4444;
}
/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  transition: opacity .25s ease;
}
.modal.show {
  display: block;
  opacity: 1;
}
.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%);
  background: #fff;
  width: 420px;
  max-width: 90%;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
  transition: transform .25s ease, opacity .25s ease;
  opacity: 0;
}
.modal.show .modal-content {
  transform: translate(-50%, -50%);
  opacity: 1;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(3px);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
#jobsTable tr {
  transition: background .2s ease;
}
#jobsTable tr:hover {
  background: rgba(0, 0, 0, .04);
}
body.is-modal-open {
  overflow: hidden;
}
#jobsTable tr {
  cursor: pointer;
}
#jobsTable tr:active {
  transform: translateY(1px);
}
.jobs-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 12px;
}
.jobs-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, .85);
}
.dd {
  position: relative;
}
.dd__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .15);
  background: #fff;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  transition: transform .12s ease, box-shadow .2s ease;
}
.dd__btn:active {
  transform: translateY(1px);
}
.dd.is-open .dd__btn {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
}
.dd__label {
  opacity: .6;
  font-weight: 700;
}
.dd__caret {
  margin-left: 6px;
  opacity: .7;
}
.dd__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .16);
  padding: 6px;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease;
}
.dd.is-open .dd__menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.dd__item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  color: #111827;
}
.dd__item:hover {
  background: rgba(99, 102, 241, .10);
}
.dd__item.is-active {
  background: rgba(99, 102, 241, .16);
}
/* ===== KPI Progress ===== */
.kpi-progress {
  margin-top: 12px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.kpi-progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.kpi-progress__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .04em;
}
.kpi-progress__value {
  font-weight: 900;
  color: #0f172a;
}
.kpi-progress__bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  overflow: hidden;
}
.kpi-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(59, 130, 246, .9), rgba(99, 102, 241, .9));
  transition: width .7s cubic-bezier(.2, .8, .2, 1);
}


.kpi-progress__fill.is-bad {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.kpi-progress__fill.is-warn {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.kpi-progress__fill.is-near {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.kpi-progress__fill.is-good {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.kpi-progress__fill.is-great {
  background: linear-gradient(90deg, #0f172a, #334155);
}



.kpi-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
}
/* ===== Mini KPIs ===== */
.kpi-mini {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.kpi-mini__item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}
.kpi-mini__label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.kpi-mini__value {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}
@media (max-width: 720px) {
  .kpi-mini {
    grid-template-columns: 1fr;
  }
}
.kpi-deltas {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  max-width: 520px;
}
.kpi-deltaLine {
  display: flex;
  font-size: 14px;
  align-items: center;
  gap: 10px;
}
.kpi-deltaLabel {
  width: 4.5em;
  font-weight: 900;
  color: rgba(17, 24, 39, .72);
}
/* バッジ共通 */
.kpi-badgeNum, .kpi-badgePct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1;
  border: 1px solid transparent;
}
.kpi-badgeNum {
  background: rgba(17, 24, 39, .05);
}
.kpi-badgePct {
  background: rgba(17, 24, 39, .05);
}
/* 上がった/下がった */
.kpi-up {
  color: #0f7a3b;
  background: rgba(22, 163, 74, .12);
  border-color: rgba(22, 163, 74, .25);
}
.kpi-down {
  color: #b91c1c;
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .22);
}
.kpi-flat {
  color: #334155;
  background: rgba(148, 163, 184, .18);
  border-color: rgba(148, 163, 184, .25);
}
/* 矢印 */
.kpi-arrow {
  font-weight: 1000;
  transform: translateY(-.5px);
}
.kpi-badgePct {
  font-size: 14px;
  font-weight: 1000;
}
.kpi-badgeNum {
  opacity: .75;
  font-weight: 800;
}
.kpi-unit-sub {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  color: rgba(17, 24, 39, .55);
  transform: translateY(-2px);
}
.kpi-valueRow {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.kpi-finComment {
  margin: 10px 0 0;
  font-weight: 900;
  color: rgba(17, 24, 39, .75);
}

.kpi--bad .kpi-finComment {
  color: #b91c1c;
}

.kpi--warn .kpi-finComment {
  color: #b45309;
}

.kpi--good .kpi-finComment {
  color: #166534;
}



/* =========================
  Experience UI (dashboard only)
========================= */
.demo-guide {
  padding: 16px 16px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .06);
}
.demo-kicker {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .14em;
  border: 1px dashed rgba(59, 130, 246, .45);
  border-radius: 999px;
  padding: 6px 10px;
}
.demo-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
}
.demo-lead {
  margin: 0;
  opacity: .75;
}
.demo-steps {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap; /* ← 折り返し禁止 */
  overflow-x: auto; /* ← 狭い時は横スクロールに逃がす */
  -webkit-overflow-scrolling: touch;
  list-style: none;
  padding: 0;
  margin: 12px 0 10px;
}
.demo-step {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .85);
  font-weight: 800;
  font-size: 12px;
  opacity: .65;
  white-space: nowrap; /* ← Step3が改行して落ちない */
  flex: 0 0 auto;
}
.demo-step.is-active {
  opacity: 1;
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.demo-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .10);
  overflow: hidden;
}
.demo-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(37, 99, 235, .9), rgba(99, 102, 241, .9));
  transition: width .4s ease;
}
.demo-next {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.demo-link {
  font-weight: 800;
  text-decoration: none;
  color: rgba(15, 23, 42, .82);
}
.demo-link:hover {
  text-decoration: underline;
}
/* floating CTA */
.demo-floating-cta {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  transition: transform .2s ease, opacity .2s ease;
  opacity: 0; /* 最初は隠す */
  pointer-events: none; /* クリック不可 */
}
.demo-floating-cta.is-show {
  opacity: 1;
  pointer-events: auto;
}
.demo-floating-cta:hover {
  transform: translateY(-2px);
}
@media (max-width: 640px) {
  .demo-floating-cta {
    right: 14px;
    bottom: 14px;
    padding: 12px 14px;
  }
}


/* =========================================
   Demo State Dock
========================================= */
.demo-stateDock {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 998;
  width: min(360px, calc(100vw - 28px));
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(2, 6, 23, .18);
}

.demo-stateDock__label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  color: #475569;
}

.demo-stateDock__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-stateBtn {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.demo-stateBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
}

.demo-stateBtn.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .24);
}

/* 状態別の軽い色ニュアンス */
.demo-stateBtn[data-demo-state="bad"].is-active {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.demo-stateBtn[data-demo-state="warn"].is-active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.demo-stateBtn[data-demo-state="near"].is-active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.demo-stateBtn[data-demo-state="good"].is-active {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.demo-stateBtn[data-demo-state="great"].is-active {
  background: linear-gradient(135deg, #0f172a, #334155);
}

/* ドックが出てもCTAを押しやすくする */
.demo-floating-cta {
  bottom: 24px;
}

@media (max-width: 640px) {
  .demo-stateDock {
    right: 14px;
    left: 14px;
    width: auto;
    bottom: 82px;
    padding: 10px;
  }

  .demo-stateDock__buttons {
    gap: 6px;
  }

  .demo-stateBtn {
    padding: 9px 11px;
    font-size: 11px;
  }
}



.demo-toast {
  position: static;
  margin: 0;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: all .25s ease;
  pointer-events: none;
  z-index: 999;
}
/* ステップ行：左=ステップ / 右=完了トースト */
.demo-stepsRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.demo-toast.is-show {
  opacity: 1;
  transform: translateY(0);
}
/* SPでは下に落とす（詰まるので） */
@media (max-width: 640px) {
  .demo-stepsRow {
    align-items: flex-start;
    flex-direction: column;
  }
  .demo-toast {
    white-space: normal;
    width: 100%;
  }
}
/* ===== Clients Demo ===== */
.demo-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .05);
}
.demo-linkStatus {
  font-size: 12px;
  color: rgba(37, 99, 235, .9);
  margin-top: 8px;
}
/* =========================================================
   PAGE SUMMARY
========================================================= */
.page-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 18px;
}
.summary-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.summary-card__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #64748b;
}
.summary-card__value {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
}
/* =========================================================
   JOBS TABLE UPGRADE
========================================================= */
#jobsTable th {
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  white-space: nowrap;
}
#jobsTable td {
  vertical-align: middle;
  white-space: nowrap;
}
.job-nameCell strong {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.job-status, .job-risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.job-status--good {
  background: rgba(22, 163, 74, .12);
  color: #166534;
}
.job-status--warn {
  background: rgba(245, 158, 11, .14);
  color: #92400e;
}
.job-status--bad {
  background: rgba(239, 68, 68, .12);
  color: #991b1b;
}
.job-risk--low {
  background: rgba(37, 99, 235, .10);
  color: #1d4ed8;
}
.job-risk--mid {
  background: rgba(245, 158, 11, .14);
  color: #92400e;
}
.job-risk--high {
  background: rgba(239, 68, 68, .12);
  color: #991b1b;
}
.jobs-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#jobsTable {
  min-width: 920px;
}
.page-jobs .container {
  max-width: 1120px;
}
.page-jobs h2 {
  margin: 0 0 18px;
}
.page-jobs .jobs-summary {
  margin-bottom: 18px;
}
.page-jobs .jobs-toolbar {
  justify-content: flex-start;
  margin: 0 0 14px;
}
.page-jobs .jobs-table-wrap {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
/* =========================================================
   CLIENTS / MINI MODAL 整頓版
========================================================= */
/* ===== Clients layout ===== */
.page-clients .container {
  max-width: 1120px;
}
.page-clients h2 {
  margin: 0 0 12px;
}
.page-clients .clients-summary {
  margin-top: 0;
}
.page-clients .clients-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-clients .client-item {
  position: relative;
  padding: 18px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  will-change: transform, opacity, background-color, border-color;
  transition:
    transform .55s cubic-bezier(.22, .8, .22, 1), opacity .35s ease, background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.page-clients .client-card__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 0;
}
.page-clients .client-head {
  min-width: 0;
}
.page-clients .client-name {
  margin: 4px 0 6px;
  font-size: 24px;
  line-height: 1.2;
}
.page-clients .client-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}
.page-clients .client-meta {
  float: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
}
/* ===== Client parts ===== */
.client-titleRow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 6px;
}
.client-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  line-height: 1;
}
.client-stat {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .05);
}
.client-stat__label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}
.client-stat__value {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}
.client-stat__value.is-strong {
  color: #2563eb;
}
.client-next {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}
.client-next__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #64748b;
}
.client-next__chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .12);
  border: 1px solid rgba(37, 99, 235, .22);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}
.client-reason {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(15, 23, 42, .06);
  color: rgba(15, 23, 42, .72);
}
.client-reason--kyumin {
  background: rgba(245, 158, 11, .12);
  color: #b45309;
}
.client-reason--shicchu {
  background: rgba(239, 68, 68, .12);
  color: #b91c1c;
}
.client-reason--shokai {
  background: rgba(16, 185, 129, .12);
  color: #047857;
}
/* ===== Clients stage ===== */
.clients-stage {
  margin: 0 0 12px;
  min-height: 24px;
}
.clients-stage__status {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: .02em;
}
/* ===== Clients animation ===== */
.page-clients .client-item.is-thinking {
  background: linear-gradient(90deg, rgba(37, 99, 235, .06), rgba(99, 102, 241, .03), rgba(37, 99, 235, .06));
  background-size: 220% 100%;
  animation: clientThinking 1.1s linear infinite;
  opacity: .92;
}
.page-clients .client-item.is-ranked {
  background: rgba(37, 99, 235, .08);
  border-color: #2563eb;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .12);
}
.page-clients .client-item.is-lower {
  opacity: .78;
  transform: scale(.985);
}
.page-clients .client-item.rank-move-left {
  animation: rankMoveLeft .55s cubic-bezier(.22, .8, .22, 1);
}
.page-clients .client-item.rank-move-down {
  animation: rankMoveDown .55s cubic-bezier(.22, .8, .22, 1);
}
.client-slot {
  list-style: none;
  border-radius: 16px;
  min-height: 118px;
}
.client-slot__inner {
  height: 100%;
  min-height: 118px;
  border: 1px dashed rgba(37, 99, 235, .22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(37, 99, 235, .04), rgba(37, 99, 235, .02));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: .04em;
}
.rank-fall {
  animation: rankFall .45s cubic-bezier(.22, .8, .22, 1);
}
.rank-enter {
  position: relative;
  animation: rankEnterRight .55s cubic-bezier(.16, .84, .22, 1);
}
.rank-enter .client-priority {
  animation: badgePop .35s ease .1s both;
}
.rank-bronze {
  border-color: rgba(180, 111, 63, .45) !important;
  box-shadow: 0 0 0 1px rgba(180, 111, 63, .18), 0 14px 28px rgba(180, 111, 63, .18);
  background:
    linear-gradient(180deg, rgba(180, 111, 63, .10), rgba(180, 111, 63, .03)), #fff;
}
.rank-silver {
  border-color: rgba(148, 163, 184, .52) !important;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, .2), 0 14px 28px rgba(148, 163, 184, .18);
  background:
    linear-gradient(180deg, rgba(203, 213, 225, .18), rgba(148, 163, 184, .04)), #fff;
}
.rank-gold {
  border-color: rgba(245, 158, 11, .58) !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .24), 0 16px 34px rgba(245, 158, 11, .22);
  background:
    linear-gradient(180deg, rgba(251, 191, 36, .16), rgba(245, 158, 11, .04)), #fff;
}
.rank-bronze::before, .rank-silver::before, .rank-gold::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  animation: rankGlow 700ms ease;
}
.rank-bronze::before {
  box-shadow: inset 0 0 0 1px rgba(180, 111, 63, .24), 0 0 24px rgba(180, 111, 63, .18);
}
.rank-silver::before {
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, .32), 0 0 26px rgba(203, 213, 225, .22);
}
.rank-gold::before {
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .36), 0 0 34px rgba(251, 191, 36, .28);
}
/* ===== Mini modal ===== */
.kpi-mini__item--button {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.kpi-mini__item--button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
  border-color: rgba(37, 99, 235, .22);
}
.kpi-mini__item--button:active {
  transform: scale(.98);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .2);
}
.kpi-mini__hint {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}
.mini-modal-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.mini-modal-card {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  padding: 12px 14px;
  background: #f8fafc;
}
.mini-modal-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.mini-modal-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}
.mini-modal-card__client {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 700;
}
.mini-modal-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.mini-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
}
.mini-chip--bad {
  background: rgba(239, 68, 68, .10);
  border-color: rgba(239, 68, 68, .18);
  color: #b91c1c;
}
.mini-chip--warn {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .18);
  color: #92400e;
}
.mini-chip--good {
  background: rgba(22, 163, 74, .10);
  border-color: rgba(22, 163, 74, .18);
  color: #166534;
}
/* ===== Modal sizing ===== */
.modal {
  padding: 24px;
  overflow-y: auto;
}
.modal-content, .modal-content--wide {
  width: min(720px, 92vw);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  margin: auto;
}
@media (max-width: 980px) {
  .page-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-clients .client-card__top {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
  .page-clients .client-meta {
    align-items: flex-start;
  }
  .page-clients .client-stats {
    grid-template-columns: 1fr;
    margin-top: 4px;
  }
}
@media (max-width: 640px) {
  .page-summary {
    grid-template-columns: 1fr;
  }
  #jobsTable {
    font-size: 13px;
  }
  .page-clients .client-name {
    font-size: 18px;
  }
  .modal {
    padding: 16px;
  }
  .modal-content, .modal-content--wide {
    width: min(100%, 96vw);
    max-height: calc(100vh - 32px);
  }
}
@keyframes clientThinking {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -20% 0;
  }
}
@keyframes rankMoveLeft {
  0% {
    transform: translateX(48px);
    opacity: .88;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes rankMoveDown {
  0% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes rankFall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(8px);
    opacity: .78;
  }
}
@keyframes rankEnterRight {
  0% {
    transform: translateX(88px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes rankGlow {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes badgePop {
  0% {
    transform: scale(.72);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}