:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue",
    Arial, sans-serif;
  font-size: 16px;
  color: #243b31;
  background: #f5f7f4;
  --ink: #20392f;
  --muted: #687a70;
  --green: #24664b;
  --line: #dfe6df;
  --card: #fff;
  --rail: 218px;
  --shadow: 0 2px 5px #2e463007;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button {
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
:focus-visible {
  outline: 3px solid #80ac55;
  outline-offset: 3px;
}
.ico {
  vertical-align: middle;
  flex-shrink: 0;
  display: inline-block;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  background: #163c33;
  color: #f4f8f1;
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.brand {
  height: 89px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 22px;
  border-bottom: 1px solid #ffffff21;
}
.brand strong,
.brand small,
.side-foot strong,
.side-foot small {
  display: block;
}
.brand strong {
  font-size: 21px;
  letter-spacing: 0.07em;
  font-weight: 650;
}
.brand small {
  margin-top: 4px;
  font-size: 12px;
  color: #c0d0c4;
  letter-spacing: 0.12em;
}
.sidebar nav {
  padding: 20px 12px;
  overflow: auto;
}
.nav-group + .nav-group {
  margin-top: 29px;
}
.nav-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #a5beb0;
  padding: 0 15px;
  margin: 3px 0 10px;
}
.nav-group a {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 42px;
  padding: 8px 15px;
  margin: 4px 0;
  border-radius: 7px;
  color: #d6e4d9;
  font-size: 15px;
}
.nav-group a:hover {
  background: #214b3e;
}
.nav-group a.active {
  background: #345b47;
  color: #e0f4a8;
  font-weight: 620;
  position: relative;
}
.nav-group a.active:before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: #c9e889;
}
.side-foot {
  border-top: 1px solid #ffffff22;
  margin: auto 20px 0;
  padding: 21px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.foot-logo {
  width: 34px;
  height: 34px;
  background: #345745;
  border: 1px solid #6b8365;
  color: #d7eab4;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-family: serif;
  font-weight: bold;
}
.side-foot strong {
  font-size: 14px;
  font-weight: 560;
}
.side-foot small {
  margin-top: 4px;
  font-size: 12px;
  color: #adc3b2;
}
.workspace {
  margin-left: var(--rail);
  min-height: 100vh;
}
.topbar {
  height: 59px;
  border-bottom: 1px solid #dce5dc;
  background: #fcfdfb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 2.5vw, 44px);
}
.crumb,
.book-switch,
.btn,
.toolbar,
.tabs,
.page-heading,
.panel-head,
.metric-top,
.series-key,
.axis-note {
  display: flex;
  align-items: center;
}
.crumb {
  gap: 13px;
  font-size: 13px;
  color: #748379;
}
.crumb-sep {
  color: #a4b0a6;
}
.crumb b {
  color: #394d40;
  font-weight: 550;
}
.book-wrap {
  position: relative;
}
.book-switch {
  background: #eff4e9;
  border: 1px solid #dce6cf;
  border-radius: 20px;
  color: #3c603f;
  gap: 7px;
  font-size: 13px;
  padding: 6px 10px;
}
.book-list {
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 15;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 5px;
  min-width: 200px;
  box-shadow: 0 8px 24px #18372c1a;
}
.book-list button {
  background: none;
  border: 0;
  width: 100%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 10px;
  border-radius: 5px;
}
.book-list button:hover {
  background: #f1f5ed;
}
.book-list strong,
.book-list small {
  display: block;
}
.book-list strong {
  font-size: 14px;
}
.book-list small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
main {
  max-width: 1760px;
  margin: 0 auto;
  padding: 28px clamp(18px, 2.5vw, 44px) 48px;
  min-width: 0;
}
.page-heading {
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}
.page-heading h1 {
  font-size: clamp(26px, 2.2vw, 38px);
  letter-spacing: -0.055em;
  line-height: 1.24;
  font-weight: 700;
}
.page-heading p,
.subtle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.page-heading p {
  margin-top: 7px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--green);
  margin-bottom: 6px;
}
.heading-actions,
.form-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid #d4dfd4;
  background: white;
  color: #34483b;
  border-radius: 7px;
  padding: 8px 14px;
  line-height: 1.4;
  font-size: 14px;
  font-weight: 540;
  white-space: nowrap;
}
.btn:hover {
  background: #f4f7f2;
  border-color: #a4bca4;
}
.btn.primary {
  background: #245b41;
  border-color: #245b41;
  color: #fff;
}
.btn.primary:hover {
  background: #174a34;
}
.icon-btn {
  background: transparent;
  border: 0;
  padding: 6px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}
.icon-btn:hover {
  background: #edf3e9;
}
.toolbar {
  gap: 10px;
  flex-wrap: wrap;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head {
  padding: 19px 21px 14px;
  gap: 12px;
  justify-content: space-between;
}
.panel-head h2,
.panel h2 {
  font-size: 18px;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.panel-head p {
  margin-top: 5px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  padding: 18px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.metric-top {
  justify-content: space-between;
  gap: 8px;
}
.metric-name {
  font-size: 14px;
  font-weight: 550;
}
.metric-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e7f0e5;
  color: #477254;
}
.metric-icon.gold {
  background: #f9eed4;
  color: #947432;
}
.metric-icon.blue {
  background: #e7f0ec;
  color: #467466;
}
.metric-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-wrap: wrap;
  margin: 13px 0 11px;
  font:
    650 clamp(23px, 2.15vw, 36px) / 1.12 "Inter",
    "Helvetica Neue",
    Arial,
    sans-serif;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.metric-unit {
  font:
    500 0.52em/1.1 "Helvetica Neue",
    Arial,
    sans-serif;
  letter-spacing: 0;
  margin: 0 2px;
}
.metric-meta {
  font-size: 12px;
  color: #687b6f;
  line-height: 1.4;
}
.metric.featured {
  background: #214e3b;
  border-color: #214e3b;
  color: white;
}
.featured .metric-icon {
  background: #3d654b;
  color: #d7efac;
}
.featured .metric-meta {
  color: #d3e1ce;
}
.featured .metric-unit {
  color: #cddccf;
}
.table-wrap {
  overflow-x: auto;
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
th {
  background: #f6f8f5;
  color: #617466;
  font-weight: 550;
  white-space: nowrap;
  font-size: 13px;
}
th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #e7ebe5;
}
td {
  color: #344a3b;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #fbfcf8;
}
.empty,
.loading,
.load-error {
  padding: 38px 18px;
  text-align: center;
  color: var(--muted);
}
.load-error p {
  margin: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: #edf3e6;
  border-radius: 5px;
  font-size: 12px;
  color: #497140;
}
.negative {
  color: #a24436 !important;
}
.positive {
  color: #276946;
}
.tabs {
  gap: 4px;
  flex-wrap: wrap;
}
.tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 6px 11px;
  color: #617465;
  font-size: 14px;
}
.tab.active {
  background: #eaf1e4;
  color: #2b5e40;
  font-weight: 600;
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-width: 0;
  border: 1px solid #d3ded2;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  line-height: 1.45;
  font-size: 14px;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23577160' viewBox='0 0 24 24'%3E%3Cpath stroke-width='1.8' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
label {
  font-size: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.form-actions {
  justify-content: flex-end;
  margin-top: 19px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}
.field small {
  font-size: 12px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  padding: 0;
  width: min(570px, calc(100% - 28px));
  max-height: 88dvh;
  box-shadow: 0 20px 90px #152e2940;
}
dialog::backdrop {
  background: #102c235f;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 21px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  font-size: 20px;
}
#dialog-body {
  padding: 20px;
}
#toasts {
  position: fixed;
  bottom: 20px;
  left: calc(50% + var(--rail) / 2);
  transform: translateX(-50%);
  z-index: 100;
  display: grid;
  gap: 8px;
  max-width: 90vw;
}
.toast {
  background: #234534;
  color: #fff;
  padding: 12px 19px;
  border-radius: 9px;
  box-shadow: 0 5px 18px #203b3226;
  font-size: 14px;
}
#shade,
.mobile-menu {
  display: none;
}
.scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.scope-controls {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.filter-pill {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid #d8e1d6;
  border-radius: 7px;
  padding-left: 11px;
  color: #667a69;
}
.filter-pill select {
  border: 0;
  background-color: transparent;
  padding-top: 7px;
  padding-bottom: 7px;
  max-width: 200px;
  font-size: 13px;
}
.range-note,
.chart-caption,
.ledger-title small {
  color: #728176;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}
.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(248px, 1fr);
  gap: 15px;
  margin: 17px 0;
}
.trend-panel,
.rank-panel {
  min-height: 246px;
}
.trend-panel .panel-head,
.rank-panel .panel-head {
  align-items: flex-start;
  padding-bottom: 4px;
}
.trend-panel .chart-caption {
  margin-top: 8px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 14px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #52665a;
  white-space: nowrap;
}
.legend i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: #337452;
}
.legend span + span i {
  background: #a1ba56;
}
.trend-stage {
  position: relative;
  padding: 0 12px 4px 8px;
  min-height: 178px;
}
.trend-svg {
  display: block;
  width: 100%;
  height: clamp(178px, 14vw, 236px);
  overflow: visible;
}
.trend-svg text {
  font-family: Arial, sans-serif;
  font-size: 12px;
  fill: #77867c;
  font-variant-numeric: tabular-nums;
}
.trend-tip {
  position: absolute;
  top: 1px;
  padding: 6px 9px;
  pointer-events: none;
  background: #233e33ed;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 5px;
}
.rank-list {
  padding: 11px 21px 17px;
  display: grid;
  gap: 14px;
}
.rank-row {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.rank-idx {
  font:
    600 13px/1.4 "Helvetica Neue",
    Arial,
    sans-serif;
  color: #8b9c8c;
}
.rank-row:first-child .rank-idx {
  color: #406843;
}
.rank-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.rank-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-line b {
  font:
    580 14px/1.4 Arial,
    sans-serif;
  color: #344e39;
}
.bar-track {
  height: 5px;
  border-radius: 2px;
  background: #eff3ec;
  margin-top: 6px;
  overflow: hidden;
}
.bar-track i {
  height: 100%;
  display: block;
  border-radius: 3px;
}
.summary-panel {
  overflow: hidden;
}
.summary-panel .panel-head {
  padding: 16px 21px;
}
.summary-panel .tabs {
  border: 1px solid #dfe6db;
  border-radius: 7px;
  background: #f6f8f3;
  padding: 2px;
}
.summary-panel .tab {
  font-size: 13px;
  padding: 4px 12px;
}
.summary-panel .tab.active {
  background: #fff;
  color: #365e3a;
  box-shadow: 0 1px 4px #314c341c;
}
.summary-panel table {
  white-space: nowrap;
}
.summary-panel th:first-child,
.summary-panel td:first-child {
  padding-left: 21px;
}
.summary-panel td strong {
  font-weight: 550;
}
.summary-panel td:not(:first-child),
.summary-panel th:not(:first-child) {
  text-align: right;
}
.summary-panel td:last-child,
.summary-panel th:last-child {
  padding-right: 21px;
}
.sku-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.summary-foot {
  border-top: 1px solid #e8eee5;
  color: #708174;
  padding: 11px 21px;
  background: #fcfdfb;
  font-size: 12px;
  line-height: 1.5;
}
.summary-foot .ico {
  margin-right: 6px;
}
.ledger-overview {
  margin-top: 23px;
}
.ledger-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ledger-title h2 {
  font-size: 18px;
}
.ledger-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fafcf8;
  border-radius: 10px;
  padding: 12px 0;
}
.ledger-strip button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 3px 16px;
}
.ledger-strip button + button {
  border-left: 1px solid var(--line);
}
.ledger-strip button:hover {
  background: #eff4eb;
}
.ledger-strip span,
.ledger-strip strong,
.ledger-strip small {
  display: block;
}
.ledger-strip span {
  color: #47614d;
  font-size: 13px;
}
.ledger-strip span .ico {
  margin-right: 6px;
}
.ledger-strip strong {
  font-size: 19px;
  margin: 7px 0 4px;
  letter-spacing: -0.03em;
}
.ledger-strip small {
  color: var(--muted);
  font-size: 12px;
}
@media (min-width: 1650px) {
  :root {
    --rail: 246px;
  }
  .brand {
    margin: 0 28px;
  }
  .sidebar nav {
    padding: 23px 18px;
  }
  .metric {
    padding: 22px;
  }
}
@media (max-width: 1170px) {
  :root {
    --rail: 188px;
  }
  .brand {
    margin: 0 15px;
  }
  .brand strong {
    font-size: 19px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 14px;
  }
  .chart-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(233px, 1fr);
  }
  .panel-head {
    padding: 16px;
  }
  .rank-list {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 900px) {
  :root {
    --rail: 164px;
  }
  .sidebar nav {
    padding: 15px 8px;
  }
  .nav-group a {
    padding-left: 10px;
    gap: 9px;
  }
  .brand {
    gap: 7px;
    margin: 0 12px;
  }
  .brand strong {
    font-size: 17px;
  }
  .side-foot {
    margin: auto 12px 0;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .rank-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
  }
  .rank-panel {
    min-height: 0;
  }
  .topbar {
    height: 52px;
  }
  .metric-icon {
    width: 26px;
    height: 26px;
  }
  .metric-value {
    font-size: 24px;
  }
  .legend {
    gap: 8px;
  }
}
@media (max-width: 720px) {
  :root {
    --rail: 0px;
  }
  .sidebar {
    width: 216px;
    transform: translateX(-100%);
    transition: transform 0.18s;
  }
  .nav-open .sidebar {
    transform: none;
  }
  .nav-open #shade {
    display: block;
    position: fixed;
    inset: 0;
    background: #10332660;
    z-index: 19;
    border: 0;
  }
  .mobile-menu {
    display: grid;
  }
  .topbar {
    padding: 0 15px;
  }
  .crumb {
    gap: 8px;
  }
  .workspace {
    margin: 0;
  }
  main {
    padding: 21px 14px 38px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .metric-value {
    font-size: 27px;
  }
  .page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .heading-actions {
    gap: 7px;
  }
  .scope-row {
    flex-wrap: wrap;
  }
  .chart-grid {
    margin: 12px 0;
    gap: 12px;
  }
  .trend-panel {
    min-height: 217px;
  }
  .trend-svg {
    height: auto;
    min-height: 145px;
  }
  .ledger-strip {
    grid-template-columns: 1fr 1fr;
    row-gap: 16px;
  }
  .ledger-strip button:nth-child(3) {
    border-left: none;
  }
  .panel-head h2,
  .panel h2 {
    font-size: 17px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .range-note {
    font-size: 12px;
  }
  th,
  td {
    padding: 10px 12px;
  }
}
@media (max-width: 440px) {
  .rank-list {
    grid-template-columns: 1fr;
  }
  .metric-top {
    gap: 3px;
  }
  .metric-name {
    font-size: 13px;
  }
  .metric-value {
    font-size: 24px;
  }
  .legend {
    gap: 6px;
  }
  .legend span {
    font-size: 12px;
  }
  .scope-row {
    gap: 6px;
  }
  .range-note {
    display: none;
  }
  .metric {
    padding: 12px;
  }
  .heading-actions .btn {
    min-height: 34px;
    padding: 6px 10px;
  }
  .trend-tip {
    font-size: 11px;
  }
  .filter-pill select {
    max-width: 160px;
  }
}
