:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --ink: #222222;
  --muted: #82786f;
  --line: #ebe3da;
  --orange: #ff7417;
  --orange-soft: #fff0da;
  --green: #24a65a;
  --red: #e64b32;
  --blue: #2f6fe4;
  --shadow: 0 18px 46px rgba(48, 35, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #fffaf3;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 24px;
}

.brand img {
  width: 46px;
  height: 46px;
}

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

.brand strong {
  font-size: 18px;
  line-height: 1.2;
}

.brand span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #5d554e;
  text-decoration: none;
}

.nav-item span {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #fff0da;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

.nav-item em {
  font-style: normal;
  font-size: 14px;
  font-weight: 650;
}

.nav-item.active {
  background: var(--orange);
  color: #ffffff;
}

.nav-item.active span {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.main {
  padding: 26px 28px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.search {
  width: 320px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search span {
  color: var(--orange);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.icon-button,
.primary-action,
.text-button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  font-weight: 750;
}

.icon-button {
  width: 38px;
  background: var(--surface);
  color: var(--orange);
  box-shadow: 0 8px 22px rgba(48, 35, 22, 0.08);
}

.primary-action {
  padding: 0 18px;
  background: var(--orange);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(255, 116, 23, 0.22);
}

.text-button {
  padding: 0 12px;
  background: var(--orange-soft);
  color: var(--orange);
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #ffd29f;
  border-radius: 8px;
  background: #fff7e8;
  color: #9a5b0c;
  font-size: 13px;
}

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

.metric,
.panel {
  background: var(--surface);
  border: 1px solid rgba(235, 227, 218, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 112px;
  padding: 18px;
}

.metric span,
.metric em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.metric strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 28px;
  line-height: 1;
}

.content-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.content-grid.two {
  grid-template-columns: 1fr 1fr;
}

.panel {
  margin-bottom: 16px;
  padding: 16px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

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

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

th,
td {
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  background: #fffaf3;
  color: #6d6259;
  font-weight: 800;
}

td {
  color: #3d3732;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}

.pill.good {
  background: #e9f8ef;
  color: var(--green);
}

.pill.warm {
  background: var(--orange-soft);
  color: var(--orange);
}

.pill.plain {
  background: #eef3ff;
  color: var(--blue);
}

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

.platform-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.platform-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--orange);
  color: #ffffff;
  font-weight: 900;
}

.platform-card strong,
.platform-card span {
  display: block;
}

.platform-card strong {
  font-size: 15px;
}

.platform-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.platform-card em {
  grid-column: 1 / -1;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.platform-card em.ok {
  color: var(--green);
}

.platform-card em.pending {
  color: var(--orange);
}

.template-list {
  display: grid;
  gap: 10px;
}

.template-list p {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fffaf3;
  color: #5d554e;
  font-size: 13px;
}

.loading {
  display: grid;
  gap: 12px;
}

.loading div {
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f3ece4, #fff8f0, #f3ece4);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 12px 14px;
  border-radius: 8px;
  background: #23201d;
  color: #ffffff;
  box-shadow: var(--shadow);
  font-size: 13px;
}

@media (max-width: 1280px) {
  body {
    min-width: 1080px;
  }

  .platform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
