:root {
  --ink: #18212f;
  --muted: #637083;
  --line: #dde4ee;
  --page: #f5f7fa;
  --panel: #ffffff;
  --red: #d34a3a;
  --amber: #c8871d;
  --green: #24875b;
  --blue: #2d6cdf;
  --teal: #14828f;
  --violet: #6b5bbd;
  --shadow: 0 18px 45px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
select {
  font: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  padding: 22px 18px;
  background: #101923;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0c35a;
  color: #101923;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-note span {
  color: #a9b5c3;
  font-size: 12px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: #c9d4e2;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #223245;
  color: #fff;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
}

.sidebar-note strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.app {
  margin-left: 252px;
  padding: 28px;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.18;
}

h2 {
  font-size: 22px;
  margin-bottom: 0;
}

h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

select {
  min-width: 132px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  margin-top: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  min-height: 132px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 30px;
}

.kpi em {
  color: var(--green);
  font-style: normal;
  font-size: 13px;
}

.wide-section {
  margin-top: 18px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.period,
.legend,
.raci-key {
  color: var(--muted);
  font-size: 13px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.legend,
.raci-key {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.red { background: var(--red); }
.amber { background: var(--amber); }
.green { background: var(--green); }

.funnel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.funnel article {
  min-height: 132px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  border-top: 4px solid var(--blue);
}

.funnel article:nth-child(2) { border-color: var(--amber); }
.funnel article:nth-child(3) { border-color: var(--violet); }
.funnel article:nth-child(4) { border-color: var(--teal); }
.funnel article:nth-child(5) { border-color: var(--green); }

.funnel strong,
.funnel span,
.funnel em {
  display: block;
}

.funnel span {
  color: var(--muted);
  margin: 8px 0 16px;
  font-size: 13px;
}

.funnel em {
  color: var(--red);
  font-size: 12px;
  font-style: normal;
}

.priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.task-card,
.product-chip,
.verify-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}

.task-card {
  padding: 14px;
}

.task-card strong {
  display: block;
  margin-bottom: 6px;
}

.task-card p,
.verify-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.S { color: #126047; background: #dff4ea; }
.badge.A { color: #9f2f25; background: #fde4df; }
.badge.B { color: #7a5417; background: #fff0cf; }
.badge.C { color: #285d9d; background: #e5f0ff; }
.badge.D { color: #5d6470; background: #edf0f4; }

.matrix {
  position: relative;
  min-height: 680px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.quadrant {
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.quadrant p {
  color: var(--muted);
  font-size: 13px;
}

.q-a { border-top: 5px solid var(--red); }
.q-s { border-top: 5px solid var(--green); }
.q-d { border-top: 5px solid #858f9e; }
.q-b { border-top: 5px solid var(--amber); }

.axis {
  position: absolute;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.axis.y {
  left: -4px;
  top: 50%;
  transform: translate(-100%, -50%) rotate(-90deg);
}

.axis.x {
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
}

.product-chip {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  margin-top: 8px;
}

.product-chip img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  background: #edf0f4;
}

.product-chip strong,
.product-chip span {
  display: block;
}

.product-chip span {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #445064;
  z-index: 1;
}

td img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #edf0f4;
}

.risk {
  font-weight: 700;
}

.risk.high { color: var(--red); }
.risk.mid { color: var(--amber); }
.risk.low { color: var(--green); }

.raci-table table {
  min-width: 1180px;
}

.raci-cell {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

.raci-cell.A { background: var(--red); }
.raci-cell.R { background: var(--blue); }
.raci-cell.C { background: var(--amber); }
.raci-cell.I { background: #8792a2; }

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.lane {
  min-height: 520px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
}

.lane h3 {
  margin-bottom: 12px;
}

.lane .task-card {
  margin-bottom: 10px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta span {
  padding: 4px 7px;
  border-radius: 6px;
  background: #f1f4f8;
  color: var(--muted);
  font-size: 12px;
}

.verification-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.verify-card {
  padding: 16px;
}

.metric-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.metric-pair div {
  padding: 10px;
  border-radius: 8px;
  background: #f7f9fb;
}

.metric-pair span,
.metric-pair strong {
  display: block;
}

.metric-pair span {
  color: var(--muted);
  font-size: 12px;
}

.metric-pair strong {
  margin-top: 4px;
  font-size: 18px;
}

@media (max-width: 1040px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 14px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    min-width: 130px;
  }

  .sidebar-note {
    display: none;
  }

  .app {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    align-items: end;
    flex-wrap: wrap;
  }

  .kpi-grid,
  .funnel,
  .priority-list,
  .verification-grid {
    grid-template-columns: 1fr;
  }

  .matrix {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .axis {
    display: none;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 23px;
  }

  h2 {
    font-size: 19px;
  }

  .toolbar,
  .field,
  select {
    width: 100%;
  }

  .icon-button {
    margin-top: 0;
  }
}
