:root {
  --bg: #f7f3eb;
  --surface: #ffffff;
  --surface-2: #f6efe3;
  --font-ui: Inter, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --type-page-title: 20px;
  --type-card-title: 16px;
  --type-body: 14px;
  --type-support: 12px;
  --type-kpi: 30px;
  --text: #16231f;
  --muted: #69766f;
  --muted-strong: #42514b;
  --border: #ebe4d8;
  --skeleton-base: #e9ecef;
  --skeleton-highlight: #f7f8f9;
  --skeleton-line: #d3d9de;
  --skeleton-block: #e0e5e9;
  --skeleton-border: #d9dee2;
  --live: #20bfa6;
  --short: #3c9ddd;
  --product: #ff8555;
  --unassigned: #8792a2;
  --total: #16231f;
  --accent: #006f63;
  --accent-soft: #e5f7f2;
  --commerce-rail: #006f63;
  --commerce-rail-deep: #00564e;
  --commerce-card-shadow: 0 10px 24px rgba(46, 38, 24, 0.06);
  --commerce-card-shadow-hover: 0 15px 34px rgba(46, 38, 24, 0.11);
  --radius-card: 12px;
  --radius-control: 10px;
  --shadow: var(--commerce-card-shadow);
  --shadow-raised: 0 12px 30px rgba(46, 38, 24, 0.085);
  --shadow-hover: var(--commerce-card-shadow-hover);
  --motion-fast: 140ms cubic-bezier(0.2, 0, 0.2, 1);
  --motion-base: 190ms cubic-bezier(0.2, 0, 0.2, 1);
  --nav-page-inset: 12px;
  --nav-sidebar-width: 218px;
  --nav-shell-gap: 14px;
  --nav-sticky-top: 12px;
  --nav-sidebar-height: calc(100vh - (var(--nav-sticky-top) * 2));
  --nav-topbar-height: 66px;
  --nav-tabs-height: 44px;
  --nav-compact-inset: 8px;
  --nav-compact-sidebar-height: calc(100vh - (var(--nav-compact-inset) * 2));
  --nav-compact-sidebar-width: 174px;
  --nav-compact-gap: 8px;
  --nav-topbar-columns: clamp(180px, 19%, 248px) minmax(0, 1fr) 240px;
  --nav-topbar-gap: 6px 12px;
  --nav-topbar-compact-columns: minmax(0, 1fr) max-content;
  --nav-topbar-compact-gap: 6px 12px;
  --nav-topbar-empty-columns: minmax(0, 1fr);
  --nav-topbar-empty-gap: 0px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 142px;
  scrollbar-gutter: stable;
  overflow-x: clip;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: cubic-bezier(0.2, 0, 0.2, 1);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--type-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  overflow-x: clip;
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
  padding-bottom: calc(40px + var(--module-scroll-extra, 0px));
}

.topbar {
  position: sticky;
  top: var(--nav-sticky-top);
  z-index: 30;
  display: grid;
  grid-template-columns: var(--nav-topbar-columns);
  grid-template-areas: "title modules controls";
  align-items: center;
  gap: var(--nav-topbar-gap);
  margin-bottom: 12px;
  min-height: var(--nav-topbar-height);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--commerce-card-shadow);
  backdrop-filter: blur(14px) saturate(1.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.16);
  transition:
    box-shadow var(--motion-base),
    border-color var(--motion-base),
    background-color var(--motion-base);
}

.topbar::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -12px;
  height: 12px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(247, 243, 235, 0.98), rgba(247, 243, 235, 0.82));
}

.topbar.is-compact {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--commerce-card-shadow);
}

.topbar-main {
  display: contents;
  grid-template-columns: var(--nav-topbar-columns);
  align-items: center;
  gap: var(--nav-topbar-gap);
}

.topbar-title {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 248px;
}

.topbar-title::before {
  content: "";
  display: none;
  width: 68px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 4px;
  background-image: url("./assets/ranboss-logo.webp"), url("./ranboss-logo.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  mix-blend-mode: multiply;
  transition: filter var(--motion-base);
}

.topbar.is-compact .topbar-title::before {
  filter: saturate(1.05);
}

.topbar-title h1 {
  font-size: var(--type-page-title);
  font-weight: 700;
  white-space: nowrap;
}

.topbar.is-compact .topbar-title h1 {
  color: var(--text);
}

.module-tabs {
  grid-area: modules;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  align-self: center;
  height: var(--nav-tabs-height);
  min-height: var(--nav-tabs-height);
  justify-content: center;
  gap: 2px;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  overflow-x: auto;
  padding: 2px 3px;
  border: 1px solid rgba(211, 222, 216, 0.72);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.module-tabs.has-scroll-start {
  box-shadow: inset 10px 0 12px -13px rgba(23, 32, 42, 0.5);
}

.module-tabs.has-scroll-end {
  box-shadow: inset -10px 0 12px -13px rgba(23, 32, 42, 0.5);
}

.module-tabs::-webkit-scrollbar {
  display: none;
}

.module-tabs a {
  min-width: 78px;
  max-width: 156px;
  min-height: 38px;
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border-bottom: 3px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: var(--type-body);
  line-height: 1;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition:
    color var(--motion-fast),
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.tab-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  flex: 0 0 14px;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.86;
}

.module-tabs .tab-icon {
  display: none;
}

.tab-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-icon--overview svg {
  fill: currentColor;
  stroke: none;
}

.module-tabs a:hover {
  color: #285948;
  background: rgba(239, 246, 242, 0.9);
  box-shadow: inset 0 0 0 1px rgba(197, 218, 207, 0.7);
}

.module-tabs a:focus-visible {
  color: var(--text);
  background: rgba(238, 243, 248, 0.72);
  outline: 2px solid rgba(23, 105, 170, 0.55);
  outline-offset: 2px;
}

.module-tabs a.is-active {
  border-bottom-color: var(--accent);
  background: linear-gradient(180deg, #ffffff, var(--accent-soft));
  color: var(--accent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
    0 2px 7px rgba(30, 70, 54, 0.08);
}

.module-tabs a.is-active .tab-icon {
  opacity: 0.96;
}

.module-tabs a:active {
  background: rgba(232, 240, 245, 0.86);
}

.platform-switch {
  grid-area: platform;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  gap: 3px;
  margin: 0;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid rgba(220, 227, 234, 0.58);
  border-radius: var(--radius-control);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 244, 249, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 1px 2px rgba(24, 39, 75, 0.08);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.platform-switch.has-scroll-start {
  box-shadow:
    inset 10px 0 12px -13px rgba(23, 32, 42, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 1px 2px rgba(24, 39, 75, 0.08);
}

.platform-switch.has-scroll-end {
  box-shadow:
    inset -10px 0 12px -13px rgba(23, 32, 42, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 1px 2px rgba(24, 39, 75, 0.08);
}

.platform-switch::-webkit-scrollbar {
  display: none;
}

.platform-switch a {
  min-width: 68px;
  max-width: 176px;
  min-height: 30px;
  display: inline-flex;
  flex: 0 1 168px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color var(--motion-fast),
    background-color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.platform-switch a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.platform-switch a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  outline: 2px solid rgba(23, 105, 170, 0.55);
  outline-offset: 2px;
}

.platform-switch a.is-active {
  background: rgba(32, 42, 53, 0.94);
  color: #fff;
  box-shadow: 0 7px 16px rgba(24, 39, 75, 0.15);
}

.platform-switch [data-switch-scope="workspace"] {
  position: relative;
  flex: 0 1 120px;
  min-width: 92px;
  max-width: 128px;
  background: rgba(255, 247, 230, 0.74);
  color: #8a5a13;
}

.platform-switch [data-switch-scope="workspace"]::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -5px;
  width: 1px;
  background: rgba(198, 176, 134, 0.76);
}

.platform-switch [data-switch-scope="workspace"].is-active {
  background: #8a5a13;
  color: #fff;
}

.platform-switch a:active {
  transform: translateY(0) scale(0.98);
}

.tab-logo {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  overflow: hidden;
  border-radius: 6px;
  background: #edf1ef;
  color: #7a858a;
  box-shadow: inset 0 0 0 1px rgba(91, 102, 117, 0.12);
}

.tab-logo svg {
  width: 15px;
  height: 15px;
  display: block;
  overflow: visible;
}

.tab-logo :is(path, rect, circle) {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.16;
  font-weight: 760;
}

.section-head h2 {
  font-size: var(--type-card-title);
  line-height: 1.25;
  font-weight: 700;
}

.topbar p,
.section-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.controls {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar .controls {
  grid-area: controls;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.topbar .controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--type-support);
  white-space: nowrap;
}

.topbar .controls label.date-control {
  gap: 0;
}

.topbar .controls input,
.topbar .controls button {
  height: 32px;
  font-size: 13px;
}

.topbar .controls input {
  width: 148px;
}

.topbar .controls button {
  padding: 0 14px;
}

.topbar .controls #refreshBtn {
  min-width: 78px;
  height: 34px;
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--accent), #11685c);
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 104, 92, 0.18);
}

.topbar .controls #refreshBtn:hover,
.topbar .controls #refreshBtn:focus-visible {
  border-color: #0d5d52;
  background: linear-gradient(145deg, #168878, #0d5d52);
  box-shadow: 0 0 0 3px rgba(20, 115, 102, 0.14), 0 10px 22px rgba(17, 104, 92, 0.18);
}

.shared-date-field {
  position: relative;
  width: 148px;
  min-width: 148px;
}

.shared-date-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0 !important;
  white-space: nowrap;
}

.topbar .controls .shared-date-trigger {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #cedbd5;
  border-radius: 7px;
  padding: 0 9px;
  background: linear-gradient(180deg, #ffffff, #f5f9f7);
  color: #315347;
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 3px rgba(25, 61, 48, 0.05);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.shared-date-trigger svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar .controls .shared-date-trigger:hover,
.topbar .controls .shared-date-trigger:focus-visible,
.topbar .controls .shared-date-trigger[aria-expanded="true"] {
  border-color: #8ebdb3;
  background: #ffffff;
  color: #0e6e61;
  box-shadow: 0 0 0 3px rgba(20, 115, 102, 0.08);
}

.shared-date-picker {
  position: fixed;
  top: var(--date-picker-top, 0px);
  left: var(--date-picker-left, 0px);
  right: auto;
  z-index: 90;
  width: 284px;
  border: 1px solid rgba(181, 204, 201, 0.76);
  border-radius: 14px;
  padding: 10px;
  background: rgba(248, 252, 251, 0.94);
  box-shadow: 0 16px 38px rgba(28, 50, 57, 0.17);
  backdrop-filter: blur(22px) saturate(1.1);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  transform-origin: top right;
  animation: shared-date-in 150ms cubic-bezier(0.2, 0, 0.2, 1);
}

.shared-date-picker[hidden] {
  display: none;
}

.shared-date-picker-head {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 4px;
  margin-bottom: 7px;
}

.shared-date-picker-head strong {
  color: #20343a;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.shared-date-picker button {
  min-width: 0;
  border-color: transparent;
  background: transparent;
  color: #415a52;
  box-shadow: none;
  transform: none;
}

.shared-date-picker-head button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
}

.shared-date-picker-head button:hover,
.shared-date-picker-head button:focus-visible {
  border-color: #bdd7d1;
  background: rgba(232, 244, 241, 0.9);
  color: #0e6e61;
  transform: none;
}

.shared-date-weekdays,
.shared-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.shared-date-weekdays {
  margin-bottom: 2px;
}

.shared-date-weekdays span {
  color: #76878c;
  text-align: center;
  font-size: var(--type-support);
  font-weight: 720;
}

.shared-date-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: #26383e;
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
}

.shared-date-grid button:hover:not(:disabled),
.shared-date-grid button:focus-visible {
  border-color: #b9d8d1;
  background: rgba(226, 241, 237, 0.92);
  color: #0c675a;
  transform: none;
}

.shared-date-grid button.is-other-month {
  color: #a1adb0;
}

.shared-date-grid button.is-today {
  border-color: #78aea3;
}

.shared-date-grid button.is-selected {
  border-color: #147366;
  background: linear-gradient(145deg, #17806f, #11685c);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(20, 115, 102, 0.22);
}

.shared-date-grid button:disabled {
  color: #c7cecc;
  cursor: not-allowed;
}

.shared-date-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(201, 218, 216, 0.82);
}

.shared-date-picker-foot button {
  height: 28px;
  padding: 0 5px;
  color: #0e6e61;
  font-size: 12px;
  font-weight: 780;
}

.shared-date-picker-foot button:hover:not(:disabled),
.shared-date-picker-foot button:focus-visible {
  color: #084f46;
  text-decoration: underline;
  transform: none;
}

@keyframes shared-date-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input,
button {
  height: 36px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  min-width: 0;
}

input {
  width: 156px;
  padding: 0 10px;
}

button {
  padding: 0 16px;
  border-color: #202a35;
  background: #202a35;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(32, 42, 53, 0.1);
  transform: translateY(0);
  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast),
    border-color var(--motion-fast),
    background-color var(--motion-fast),
    color var(--motion-fast);
}

button:hover {
  box-shadow: 0 8px 18px rgba(32, 42, 53, 0.16);
  transform: translateY(-1px);
}

button:active {
  box-shadow: 0 3px 8px rgba(32, 42, 53, 0.12);
  transform: translateY(0) scale(0.985);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(23, 105, 170, 0.55);
  outline-offset: 2px;
}

.status-meta-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.status-meta-strip::-webkit-scrollbar {
  display: none;
}

.status-line {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}

.status-meta-strip .status-line {
  flex: 0 0 auto;
  min-height: 32px;
  margin-bottom: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8792a0;
}

.dot.ok {
  background: #2d8f74;
}

.dot.error {
  background: var(--unassigned);
}

.meta-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.status-meta-strip .meta-line {
  flex: 0 1 auto;
  min-width: 0;
  margin-bottom: 0;
  flex-wrap: nowrap;
}

.meta-line span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 10px;
}

.status-meta-strip .meta-line span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin: 14px 0 18px;
}

#overviewPanel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

#overviewPanel .summary-grid {
  grid-column: 1 / -1;
  margin: 14px 0 4px;
}

#overviewPanel .trend-panel {
  grid-column: span 8;
}

#overviewPanel .shop-sales-panel {
  grid-column: span 4;
}

#overviewPanel,
#trendPanel,
#shopSalesPanel,
#profitPanel,
#adCostPanel,
#creatorCommissionPanel,
#knownProfitPanel,
#treePanel,
#issuesPanel {
  scroll-margin-top: 150px;
}

.metric-card {
  min-height: 148px;
  display: grid;
  align-content: space-between;
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 19px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
  box-shadow: var(--commerce-card-shadow);
  transform: translateY(0);
  transition:
    transform var(--motion-base),
    box-shadow var(--motion-base),
    border-color var(--motion-base),
    background-color var(--motion-base);
}

.metric-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 760;
}

.metric-card .status {
  max-width: 96px;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.25;
  text-align: right;
}

.metric-card .status.is-true-zero,
.field-status.is-true-zero,
.zero-note.is-true-zero {
  color: #2f7d5c;
}

.metric-card .status.is-partial,
.field-status.is-partial,
.zero-note.is-partial {
  color: #8a6418;
}

.metric-card .status.is-pending,
.field-status.is-pending,
.zero-note.is-pending {
  color: #8a6418;
}

.metric-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: var(--type-kpi);
  line-height: 1.05;
  font-weight: 820;
}

.zero-note {
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.35;
}

.metric-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.metric-card dt {
  color: var(--muted);
  font-size: var(--type-support);
}

.metric-card dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 780;
}

.field-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field-status.is-ok {
  color: #2f7d5c;
}

/* Unified desktop shell. Platform pages keep their own modules and data contracts. */
.dashboard-app {
  width: min(1540px, calc(100vw - (var(--nav-page-inset) * 2)));
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--nav-sidebar-width) minmax(0, 1fr);
  gap: var(--nav-shell-gap);
}

.dashboard-app > .shell {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: var(--nav-sticky-top) 0 40px;
}

.dashboard-sidebar {
  position: sticky;
  top: var(--nav-sticky-top);
  align-self: start;
  height: var(--nav-sidebar-height);
  min-height: 620px;
  padding: 18px 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, var(--commerce-rail) 0%, var(--commerce-rail-deep) 100%);
  box-shadow: 0 16px 34px rgba(0, 86, 78, 0.18);
  backdrop-filter: blur(14px);
}

.rail-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 5px 24px;
  color: #ffffff;
  text-decoration: none;
}

.rail-brand .brand-mark {
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  background-image: url("./assets/ranboss-logo.webp"), url("./ranboss-logo.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  mix-blend-mode: normal;
  filter: brightness(0) invert(1);
}

.rail-brand > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rail-brand b {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.rail-brand small,
.rail-foot {
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--type-support);
}

.rail-label {
  margin: 0 8px 8px;
  color: rgba(255, 255, 255, 0.58);
  font-size: var(--type-support);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.platform-rail {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 6px;
}

.platform-rail a {
  --platform-theme: #147366;
  --platform-tint: rgba(255, 255, 255, 0.12);
  position: relative;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--type-body);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: color var(--motion-fast), background-color var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast);
}

.platform-rail a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--platform-theme);
  opacity: 0;
  transform: scaleY(0.55);
  transition: opacity var(--motion-fast), transform var(--motion-fast);
}

.platform-rail a[data-platform-icon="douyin"] { --platform-theme: #c84968; --platform-tint: #fbeaf0; }
.platform-rail a[data-platform-icon="kuaishou"] { --platform-theme: #e8662d; --platform-tint: #fff0e8; }
.platform-rail a[data-platform-icon="wechat_shop"] { --platform-theme: #15945a; --platform-tint: #e6f5ed; }
.platform-rail a[data-platform-icon="private_domain"] { --platform-theme: #7358b1; --platform-tint: #f0ecf9; }
.platform-rail a[data-platform-icon="schedule"] { --platform-theme: #a76b20; --platform-tint: #fbf0df; }

.platform-rail a:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.platform-rail a:focus-visible {
  outline: 2px solid rgba(23, 105, 170, 0.6);
  outline-offset: 2px;
}

.platform-rail .tab-logo {
  width: 25px;
  height: 25px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.platform-rail a.is-active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.platform-rail a.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.platform-rail a.is-active .tab-logo {
  background: #ffffff;
  color: var(--commerce-rail);
  box-shadow: 0 6px 12px rgba(0, 55, 50, 0.12);
}

.platform-rail a small {
  color: rgba(255, 255, 255, 0.56);
  font-size: var(--type-support);
  font-weight: 650;
}

.rail-foot {
  position: absolute;
  left: 21px;
  bottom: 14px;
  margin: 0;
}

.platform-rail [data-switch-scope="workspace"] {
  border-style: solid;
}

.topbar {
  grid-template-columns: var(--nav-topbar-columns);
  grid-template-areas: "title modules controls";
}

@media (max-width: 1100px) {
  .dashboard-app {
    width: calc(100vw - (var(--nav-compact-inset) * 2));
    grid-template-columns: var(--nav-compact-sidebar-width) minmax(0, 1fr);
    gap: var(--nav-compact-gap);
  }

  .dashboard-sidebar {
    top: var(--nav-compact-inset);
    height: var(--nav-compact-sidebar-height);
    padding-inline: 9px;
  }

  .dashboard-app > .shell {
    padding-top: var(--nav-compact-inset);
  }

  .platform-rail a {
    min-height: 40px;
    padding: 0 9px;
  }

  .topbar {
    top: var(--nav-compact-inset);
    grid-template-columns: var(--nav-topbar-compact-columns);
    gap: var(--nav-topbar-compact-gap);
    grid-template-areas:
      "title controls"
      "modules modules";
  }

  .module-tabs {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 1ms;
  }

  .shared-date-picker {
    animation: none;
  }
}

.gap-wrap {
  position: relative;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
}

.metric-card,
.tree-card,
.issue-card {
  position: relative;
}

.gap-trigger {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d9e3ee;
  border-radius: 6px;
  background: #f5f8fb;
  color: #344252;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: help;
}

.gap-trigger:focus-visible {
  outline: 2px solid #1769aa;
  outline-offset: 2px;
}

.gap-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483000;
  width: min(360px, calc(100vw - 24px));
  max-height: var(--gap-tooltip-max-height, calc(100vh - 24px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
  color: #172231;
  box-shadow: 0 18px 45px rgba(23, 34, 49, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: auto;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.gap-wrap:hover .gap-tooltip,
.gap-wrap:focus-within .gap-tooltip,
.gap-trigger:is(:hover, :focus-visible) + .gap-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.gap-tooltip > strong {
  font-size: 12px;
}

.gap-item {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #edf2f7;
}

.gap-item b,
.gap-item em,
.gap-item small,
.gap-item i,
.gap-code-row,
.gap-explain-row {
  font-style: normal;
  line-height: 1.45;
}

.gap-item b {
  font-size: 12px;
}

.gap-item em,
.gap-item small,
.gap-item i,
.gap-code-row,
.gap-explain-row {
  color: var(--muted);
  font-size: var(--type-support);
}

.gap-code-row,
.gap-explain-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.gap-code-row > span,
.gap-explain-row > span {
  color: #6b7785;
  font-weight: 700;
}

.gap-item code {
  min-width: 0;
  padding: 2px 5px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #1f2b3a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: var(--type-support);
  overflow-wrap: anywhere;
}

.gap-item i {
  color: #344252;
}

.metric-card.live {
  --overview-kpi-accent: var(--live);
  --overview-kpi-accent-deep: #0a9f8c;
  border-top: 4px solid var(--live);
}

.metric-card.short_video {
  --overview-kpi-accent: var(--short);
  --overview-kpi-accent-deep: #237fc4;
  border-top: 4px solid var(--short);
}

.metric-card.product_card {
  --overview-kpi-accent: var(--product);
  --overview-kpi-accent-deep: #ee683f;
  border-top: 4px solid var(--product);
}

.metric-card.unassigned {
  border-top: 4px solid var(--unassigned);
}

.metric-card.total {
  border-top: 4px solid var(--total);
  background: #fdfefe;
}

#overviewPanel .metric-card:is(.live, .short_video, .product_card) {
  border: 1px solid color-mix(in srgb, var(--overview-kpi-accent) 72%, #ffffff);
  border-top: 0;
  background:
    linear-gradient(135deg, var(--overview-kpi-accent) 0%, var(--overview-kpi-accent-deep) 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--overview-kpi-accent) 22%, transparent);
}

#overviewPanel .metric-card:is(.live, .short_video, .product_card) h3,
#overviewPanel .metric-card:is(.live, .short_video, .product_card) strong,
#overviewPanel .metric-card:is(.live, .short_video, .product_card) dd {
  color: #ffffff;
}

#overviewPanel .metric-card:is(.live, .short_video, .product_card) dt,
#overviewPanel .metric-card:is(.live, .short_video, .product_card) .status,
#overviewPanel .metric-card:is(.live, .short_video, .product_card) .field-status,
#overviewPanel .metric-card:is(.live, .short_video, .product_card) .zero-note {
  color: rgba(255, 255, 255, 0.78);
}

#overviewPanel .metric-card:is(.unassigned, .total) {
  background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
  box-shadow: var(--commerce-card-shadow);
}

@media (hover: hover) {
  .metric-card:hover,
  .tree-card:hover,
  .issue-card:hover,
  .profit-option:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
  }

  .metric-card:hover {
    border-color: #c7d3df;
  }

  .trend-panel:hover,
  .shop-sales-panel:hover,
  .ad-cost-panel:hover,
  .creator-commission-panel:hover,
  .net-profit-panel:hover,
  .profit-panel:hover,
  .tree-panel:hover,
  .issues-panel:hover {
    box-shadow: var(--shadow-hover);
  }
}

.metric-card:has(.gap-wrap:hover),
.metric-card:has(.gap-wrap:focus-within),
.tree-card:has(.gap-wrap:hover),
.tree-card:has(.gap-wrap:focus-within),
.issue-card:has(.gap-wrap:hover),
.issue-card:has(.gap-wrap:focus-within) {
  z-index: 60;
  transform: none;
}

.trend-panel,
.shop-sales-panel,
.ad-cost-panel,
.creator-commission-panel,
.net-profit-panel,
.profit-panel,
.tree-panel,
.issues-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
  box-shadow: var(--commerce-card-shadow);
  padding: 20px;
  transition:
    box-shadow var(--motion-base),
    border-color var(--motion-base),
    background-color var(--motion-base);
}

#overviewPanel .trend-panel,
#overviewPanel .shop-sales-panel {
  min-width: 0;
  background: #ffffff;
  border-color: var(--border);
}

.shop-sales-panel,
.profit-panel,
.ad-cost-panel,
.creator-commission-panel,
.net-profit-panel,
.tree-panel,
.issues-panel {
  margin-top: 18px;
}

.ad-cost-grid,
.creator-commission-grid,
.net-profit-summary {
  display: grid;
  gap: 10px;
}

.ad-cost-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.creator-commission-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.net-profit-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.net-profit-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbfd 0%, #f3f7fb 100%);
}

.net-profit-controls label,
.net-profit-search {
  min-width: 0;
}

.net-profit-search {
  grid-column: span 3;
}

.net-profit-controls input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.net-profit-controls button {
  align-self: end;
  height: 36px;
  padding: 0 12px;
  width: 100%;
}

.net-profit-note {
  margin-top: 10px;
}

.net-profit-table-wrap {
  margin-top: 12px;
}

.net-profit-table {
  min-width: 1180px;
}

.net-profit-table td:nth-child(n+3):nth-child(-n+10),
.net-profit-table th:nth-child(n+3):nth-child(-n+10) {
  text-align: right;
}

.net-profit-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.35;
}

.shop-sales-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef7f3;
  color: #287154;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.shop-sales-status.is-partial {
  background: #fff6e8;
  color: #8a6418;
}

.shop-sales-table-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
}

.shop-sales-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.shop-sales-table th,
.shop-sales-table td {
  padding: 10px 9px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

.shop-sales-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f9fc;
  color: #445164;
  font-size: var(--type-support);
  font-weight: 800;
}

.shop-sales-table tbody tr:last-child td {
  border-bottom: 0;
}

.shop-sales-table tbody tr {
  transition:
    background-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.shop-sales-table tbody tr:hover {
  background: #f7fbff;
}

.shop-sales-table td:nth-child(n+2),
.shop-sales-table th:nth-child(n+2) {
  text-align: right;
}

.shop-sales-table b {
  display: block;
  color: #17202a;
  font-size: 12px;
}

.shop-sales-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.delta-up {
  color: #287154;
  font-weight: 800;
}

.delta-down {
  color: #a83f49;
  font-weight: 800;
}

.delta-flat {
  color: #516174;
  font-weight: 800;
}

.delta-missing {
  color: var(--muted);
  font-weight: 700;
}

.ad-cost-quality {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f7fafc;
}

.ad-quality-title {
  display: grid;
  gap: 2px;
  min-width: 160px;
}

.ad-quality-title b {
  font-size: 13px;
}

.ad-quality-title span {
  color: var(--muted);
  font-size: 12px;
}

.ad-quality-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ad-quality-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef5fb;
  color: #344252;
  font-size: var(--type-support);
  font-weight: 800;
  white-space: nowrap;
}

.ad-quality-chip b {
  font-size: 12px;
}

.ad-quality-chip.actual {
  background: #edf9f3;
  color: #287154;
}

.ad-quality-chip.estimated,
.ad-quality-chip.pending {
  background: #fff6e8;
  color: #8a6418;
}

.ad-quality-chip.missing,
.ad-quality-chip.conflict {
  background: #fff1f3;
  color: #9a3440;
}

.ad-cost-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) minmax(220px, 1.4fr) auto;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f8fafc;
}

.ad-cost-filters label {
  min-width: 0;
}

.ad-cost-filters select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.ad-cost-filters button {
  align-self: end;
  height: 36px;
  padding: 0 12px;
}

.ad-cost-note {
  margin-top: 10px;
}

.ad-cost-reconcile {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f7fafc;
  color: #344252;
  font-size: 12px;
}

.ad-cost-reconcile > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ad-cost-reconcile p {
  margin: 0;
  line-height: 1.45;
}

.ad-cost-table {
  min-width: 1320px;
}

.ad-cost-table td:nth-child(n+6):nth-child(-n+10),
.ad-cost-table th:nth-child(n+6):nth-child(-n+10) {
  text-align: right;
}

.ad-cost-table-wrap {
  margin-top: 12px;
}

.ad-cost-table tr.is-selected {
  background: #f6fbff;
}

.ad-cost-table tbody tr,
.creator-table tbody tr,
.profit-table tbody tr,
.schedule-table tbody tr {
  transition:
    background-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.ad-cost-table tbody tr:hover,
.profit-table tbody tr:hover,
.schedule-table tbody tr:hover {
  background: #f7fbff;
}

.ad-drill-button {
  width: auto;
  min-height: 24px;
  margin-top: 6px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: var(--type-support);
  font-weight: 800;
}

.ad-cost-drilldown {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f7fafc;
}

.ad-drill-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ad-drill-head > div {
  display: grid;
  gap: 3px;
}

.ad-drill-head span {
  color: var(--muted);
  font-size: 12px;
}

.ad-drill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ad-drill-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e4ebf2;
  border-radius: 8px;
  background: #fff;
}

.ad-drill-grid span,
.ad-drill-grid small,
.ad-cost-drilldown p {
  color: var(--muted);
  font-size: 12px;
}

.ad-drill-grid b {
  overflow-wrap: anywhere;
}

.ad-cost-drilldown p {
  margin: 0;
}

.creator-commission-note {
  margin-top: 10px;
}

.creator-commission-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(420px, 0.86fr);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
}

.creator-commission-main {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.creator-commission-table-wrap {
  margin-top: 0;
  overflow-x: auto;
}

.profit-table.creator-commission-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}

.creator-commission-table th:nth-child(1),
.creator-commission-table td:nth-child(1) {
  width: 24%;
}

.creator-commission-table th:nth-child(2),
.creator-commission-table td:nth-child(2) {
  width: 15%;
}

.creator-commission-table th:nth-child(3),
.creator-commission-table td:nth-child(3) {
  width: 8%;
}

.creator-commission-table th:nth-child(4),
.creator-commission-table td:nth-child(4) {
  width: 22%;
}

.creator-commission-table th:nth-child(5),
.creator-commission-table td:nth-child(5) {
  width: 22%;
}

.creator-commission-table th:nth-child(6),
.creator-commission-table td:nth-child(6) {
  width: 9%;
}

.creator-commission-table td:nth-child(n+2):nth-child(-n+4),
.creator-commission-table th:nth-child(n+2):nth-child(-n+4) {
  text-align: right;
}

.creator-commission-table th:nth-child(5),
.creator-commission-table td:nth-child(5),
.creator-commission-table th:nth-child(6),
.creator-commission-table td:nth-child(6) {
  text-align: left;
}

.creator-commission-table tr.is-selected {
  background: #f6fbff;
}

.creator-commission-table td small,
.creator-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.35;
}

.creator-commission-money {
  display: block;
  color: #17202a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.creator-commission-rate,
.creator-commission-meta,
.creator-commission-status-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.creator-commission-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 6px;
}

.creator-commission-detail {
  min-width: 0;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.creator-commission-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe5ee;
  background: #f8fbfd;
}

.creator-commission-detail-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.creator-commission-detail-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.3;
}

.creator-commission-creators {
  overflow: auto;
  max-height: 440px;
  background: #fff;
}

.creator-commission-filters {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #e4ebf2;
  background: #fff;
}

.creator-commission-filters button {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #d5e0ea;
  border-radius: 6px;
  background: #f7fafc;
  color: #405163;
  font-size: var(--type-support);
  font-weight: 750;
  cursor: pointer;
}

.creator-commission-filters button:hover,
.creator-commission-filters button.is-active {
  border-color: #2d8f74;
  background: #edf8f2;
  color: #1f6f59;
}

.creator-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.25;
}

.creator-table thead th {
  position: sticky;
  top: 43px;
  z-index: 1;
  background: #f7fafc;
  box-shadow: 0 1px 0 #dbe5ee;
}

.creator-table th,
.creator-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e4ebf2;
  text-align: left;
  vertical-align: middle;
}

.creator-table th:nth-child(1),
.creator-table td:nth-child(1) {
  width: 40%;
}

.creator-table th:nth-child(2),
.creator-table td:nth-child(2) {
  width: 19%;
}

.creator-table th:nth-child(3),
.creator-table td:nth-child(3) {
  width: 11%;
}

.creator-table th:nth-child(4),
.creator-table td:nth-child(4) {
  width: 30%;
}

.creator-table th:nth-child(n+2),
.creator-table td:nth-child(n+2) {
  text-align: right;
}

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

.creator-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.creator-table tbody tr:hover {
  background: #f3f8fb;
}

.creator-display-cell {
  min-width: 0;
}

.creator-name,
.creator-id {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-name {
  color: #17202a;
  font-size: 12px;
  line-height: 1.25;
}

.creator-id {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.2;
}

.creator-owner-type {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef5f7;
  color: #405163;
}

.creator-detail-number,
.creator-order-count {
  color: #17202a;
  font-size: 12px;
  font-weight: 750;
}

.creator-commission-stack {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.creator-commission-stack .creator-commission-money {
  font-size: 12px;
  text-align: right;
  white-space: normal;
}

.creator-commission-stack .creator-commission-rate,
.creator-commission-stack .creator-commission-meta {
  margin-top: 0;
  text-align: right;
}

.creator-commission-status-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 3px 6px;
}

.creator-commission-status-line .cost-badge {
  min-height: 18px;
  padding: 0 6px;
  font-size: var(--type-support);
  line-height: 18px;
}

.creator-status-counts {
  color: var(--muted);
  font-size: var(--type-support);
  white-space: nowrap;
}

.creator-commission-issues {
  display: grid;
  gap: 8px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f7fafc;
}

.creator-commission-issue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.creator-commission-issue-list {
  display: grid;
  gap: 8px;
}

.creator-commission-issue-list > div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #e4ebf2;
  border-radius: 8px;
  background: #fff;
}

.creator-commission-issue-list span,
.creator-commission-issue-list small {
  color: var(--muted);
  font-size: 12px;
}

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

.trend-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  background: #f7f0e6;
}

button.ghost {
  width: 58px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

button.ghost.is-active {
  background: var(--accent);
  color: #fff;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

i.live {
  background: var(--live);
}

i.short {
  background: var(--short);
}

i.product {
  background: var(--product);
}

i.unassigned {
  background: var(--unassigned);
}

.profit-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.profit-status.is-ok {
  border-color: #c8eadc;
  background: #f1fbf6;
  color: #287154;
}

.profit-status.is-warn {
  border-color: #f1dfb8;
  background: #fff9ed;
  color: #8a6418;
}

.profit-status.is-error {
  border-color: #efd1d5;
  background: #fff4f5;
  color: #9a3440;
}

.profit-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbfd 0%, #f3f7fb 100%);
}

.profit-search-input {
  grid-column: span 2;
  min-width: 0;
}

.profit-controls input {
  width: 100%;
}

.profit-controls button {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.profit-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.profit-options:empty {
  display: none;
}

.profit-options-empty {
  border: 1px dashed #d9e2ec;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
}

.profit-option {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(230px, 1.8fr) 70px 110px 100px auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2936;
  padding: 9px 10px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(24, 39, 75, 0.04);
  transform: translateY(0);
  transition:
    transform var(--motion-base),
    box-shadow var(--motion-base),
    border-color var(--motion-base),
    background-color var(--motion-base);
}

.profit-option:hover {
  border-color: #9fb5ca;
  background: #f8fbfe;
}

.profit-option:active {
  transform: translateY(-1px) scale(0.995);
}

.profit-option b {
  display: block;
  font-size: 13px;
}

.profit-option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--type-support);
  overflow-wrap: anywhere;
}

.profit-option > span:nth-child(n+2) {
  justify-self: end;
  color: #344252;
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
}

.profit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.profit-kpi {
  min-width: 0;
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid #e1e8ef;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.profit-kpi span {
  color: var(--muted);
  font-size: var(--type-support);
  font-weight: 700;
}

.profit-kpi strong {
  min-width: 0;
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.profit-kpi small {
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profit-kpi.is-profit strong {
  color: #236f55;
}

.profit-kpi.is-gap strong {
  color: #9a3440;
}

.profit-kpi.is-neutral {
  background: #f7fafc;
}

.profit-kpi.is-neutral strong {
  color: #344252;
}

.profit-note {
  margin-top: 10px;
}

.profit-note:empty {
  display: none;
}

.profit-note-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  border: 1px solid #f1dfb8;
  border-radius: 8px;
  background: #fff9ed;
  color: #5f4617;
  padding: 10px 12px;
  font-size: 12px;
}

.profit-note-card b {
  color: #8a6418;
  font-size: 12px;
}

.profit-note-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profit-note-card small {
  grid-column: 1 / -1;
  color: #81642b;
  line-height: 1.45;
}

.profit-note-card-neutral {
  border-color: #dbe5ee;
  background: #f7fafc;
  color: #344252;
}

.profit-note-card-neutral b,
.profit-note-card-neutral small {
  color: #516174;
}

.profit-table-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: auto;
}

.profit-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.profit-table th,
.profit-table td {
  padding: 10px 9px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

.profit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f9fc;
  color: #445164;
  font-size: var(--type-support);
  font-weight: 800;
}

.profit-table td:nth-child(n+4):nth-child(-n+10),
.profit-table th:nth-child(n+4):nth-child(-n+10) {
  text-align: right;
}

.profit-table b {
  display: block;
  color: #17202a;
  font-size: 12px;
}

.profit-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.cost-unit-note {
  color: #516174;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.refund-detail-panel {
  margin-top: 16px;
  border-top: 1px solid #e6edf4;
  padding-top: 16px;
}

.refund-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.refund-detail-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.refund-detail-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.refund-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.refund-type-list {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.refund-type-badge,
.refund-type-empty {
  min-height: 34px;
  display: inline-grid;
  align-content: center;
  gap: 2px;
  border: 1px solid #dfe8f1;
  border-radius: 8px;
  background: #fbfdff;
  padding: 7px 9px;
  color: #263442;
  font-size: var(--type-support);
}

.refund-type-badge b,
.refund-type-badge em,
.refund-type-badge small {
  font-style: normal;
  line-height: 1.25;
}

.refund-type-badge em,
.refund-type-badge small,
.refund-type-empty {
  color: var(--muted);
}

.refund-table {
  min-width: 1060px;
}

.refund-table td:nth-child(n+5):nth-child(-n+7),
.refund-table th:nth-child(n+5):nth-child(-n+7) {
  text-align: right;
}

.schedule-panel {
  scroll-margin-top: 116px;
}

.schedule-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  overflow: visible;
}

.schedule-controls label {
  flex: 0 1 170px;
  min-width: 0;
}

.schedule-controls button,
.schedule-upload {
  width: auto;
  min-width: 86px;
  padding: 0 12px;
  white-space: nowrap;
}

.schedule-controls button.ghost {
  width: auto;
  min-width: 86px;
  height: 38px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background: #fff;
  color: #516174;
  font-size: 13px;
}

.schedule-upload {
  flex: 0 1 230px;
  position: relative;
  gap: 6px;
  cursor: pointer;
}

.schedule-upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.schedule-upload-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
}

.schedule-upload-control {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background: #fff;
  color: #344252;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(24, 39, 75, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.schedule-upload-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: #202a35;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
}

.schedule-upload:hover .schedule-upload-control,
.schedule-upload:focus-within .schedule-upload-control {
  border-color: #9fb5ca;
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.1);
  transform: translateY(-1px);
}

.schedule-note {
  margin-top: 12px;
}

.schedule-note:empty {
  display: none;
}

.schedule-note-card {
  border: 1px solid #dbe6ef;
  border-radius: 8px;
  background: #f8fbfe;
  padding: 10px 12px;
  color: #344252;
  font-size: 12px;
}

.schedule-note-card.warn {
  border-color: #f1dfb8;
  background: #fff9ed;
  color: #684d18;
}

.schedule-note-card.error {
  border-color: #efd1d5;
  background: #fff4f5;
  color: #8a2d38;
}

.schedule-note-card.ok {
  border-color: #c8eadc;
  background: #f1fbf6;
  color: #287154;
}

.schedule-note-card p {
  margin: 0;
}

.schedule-note-card ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.schedule-note-card li {
  margin: 4px 0;
}

.schedule-table-wrap {
  margin-top: 12px;
  overflow-x: clip;
  overflow-y: visible;
}

.schedule-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.schedule-col-live-room {
  width: 8%;
}

.schedule-col-account {
  width: 14%;
}

.schedule-col-media {
  width: 9%;
}

.schedule-col-time {
  width: 12%;
}

.schedule-col-duration {
  width: 7%;
}

.schedule-col-anchor {
  width: 8%;
}

.schedule-col-assistant {
  width: 10%;
}

.schedule-col-promotion {
  width: 11%;
}

.schedule-col-status {
  width: 9%;
}

.schedule-col-actions {
  width: 12%;
}

.schedule-table th,
.schedule-table td,
.schedule-table td:nth-child(n+4):nth-child(-n+10),
.schedule-table th:nth-child(n+4):nth-child(-n+10) {
  border: 1px solid #c8d2dc;
  padding: 7px 5px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.schedule-table thead th {
  background: #f3f6f9;
  color: #2f3945;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.schedule-table tbody td {
  background: #fff;
}

.schedule-table input,
.schedule-table select,
.schedule-table textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d6e0ea;
  border-radius: 5px;
  background: #fff;
  padding: 7px 8px;
  font-size: var(--type-support);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.schedule-table textarea {
  min-height: 54px;
  max-height: 116px;
  resize: vertical;
  white-space: pre-wrap;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.schedule-time-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.schedule-time-range input[type="text"] {
  height: 30px;
  padding-left: 6px;
  padding-right: 6px;
  font-size: var(--type-support);
}

.schedule-time-range span {
  color: #596777;
  font-size: var(--type-support);
  line-height: 1;
}

.schedule-stacked-field {
  display: grid;
  gap: 6px;
}

.schedule-duration,
.schedule-duration-input {
  color: #1f2a37;
  font-weight: 800;
  text-align: center;
}

.schedule-duration-input {
  height: 32px;
  padding-left: 4px;
  padding-right: 4px;
}

.schedule-account-id-input {
  height: 30px;
  color: #475569;
  font-size: var(--type-support);
}

.schedule-table tr.needs-review {
  background: #fffaf0;
}

.schedule-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid #dbe6ef;
  border-radius: 7px;
  background: #f8fbfe;
  color: #344252;
  justify-content: center;
  width: 100%;
  padding: 2px 5px;
  font-size: var(--type-support);
  line-height: 1.25;
  font-weight: 740;
  white-space: normal;
}

.schedule-badge.validated,
.schedule-badge.confirmed,
.schedule-badge.executed {
  border-color: #c8eadc;
  background: #f1fbf6;
  color: #287154;
}

.schedule-badge.conflict {
  border-color: #efd1d5;
  background: #fff4f5;
  color: #9a3440;
}

.schedule-review {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--type-support);
}

.schedule-review input {
  width: auto;
  min-width: 0;
}

.schedule-row-actions {
  display: grid;
  gap: 5px;
}

.schedule-row-actions .schedule-insert,
.schedule-row-actions .schedule-delete {
  width: 100%;
  height: auto;
  min-height: 28px;
  border: 1px solid #cfe0ee;
  border-radius: 6px;
  background: #f7fbff;
  color: #1769aa;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
}

.schedule-row-actions .schedule-delete {
  border-color: #efd1d5;
  background: #fff6f7;
  color: #9a3440;
}

.cost-badge.matched {
  background: #edf9f3;
  color: #287154;
}

.cost-badge.missing {
  background: #fff1f3;
  color: #9a3440;
}

.cost-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef5fb;
  color: #344252;
  font-size: var(--type-support);
  font-weight: 800;
  white-space: nowrap;
}

.cost-badge.actual_cost {
  background: #edf9f3;
  color: #287154;
}

.cost-badge.estimated_cost {
  background: #fff6e8;
  color: #8a6418;
}

.cost-badge.estimated,
.cost-badge.pending {
  background: #fff6e8;
  color: #8a6418;
}

.cost-badge.actual {
  background: #edf9f3;
  color: #287154;
}

.cost-badge.conflict {
  background: #fff1f3;
  color: #9a3440;
}

.cost-badge.missing_cost,
.cost-badge.missing_mapping,
.cost-badge.has_cost_gap,
.cost-badge.suspect_code {
  background: #fff1f3;
  color: #9a3440;
}

.chart-frame {
  position: relative;
  height: 360px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 246, 239, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

svg {
  width: 100%;
  height: 100%;
  display: block;
}

.axis,
.grid {
  stroke: #dce5ee;
  stroke-width: 1;
}

.axis {
  stroke: #b9c7d4;
}

.axis-label {
  fill: #667386;
  font-size: var(--type-support);
  font-variant-numeric: tabular-nums;
}

.line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-width 160ms ease, opacity 160ms ease, filter 160ms ease;
}

.line.is-hovered {
  stroke-width: 5;
  opacity: 1;
  filter: drop-shadow(0 4px 8px rgba(23, 32, 42, 0.16));
}

.line.is-muted {
  opacity: 0.2;
}

.line-hit {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 18;
  cursor: crosshair;
  pointer-events: stroke;
}

.line-hit:focus-visible {
  outline: 2px solid rgba(23, 105, 170, 0.45);
  outline-offset: 3px;
}

.trend-hover-layer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.trend-hover-layer.is-visible {
  opacity: 1;
}

.trend-hover-rule {
  stroke: rgba(41, 50, 65, 0.22);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.trend-hover-dot {
  stroke: #fff;
  stroke-width: 3;
  filter: drop-shadow(0 5px 10px rgba(23, 32, 42, 0.18));
}

.trend-tooltip {
  position: absolute;
  z-index: 4;
  width: 214px;
  max-width: calc(100% - 16px);
  border: 1px solid rgba(185, 199, 212, 0.9);
  border-left: 4px solid var(--trend-color, var(--total));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(24, 39, 75, 0.16);
  color: var(--text);
  opacity: 0;
  padding: 10px 11px;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.trend-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.trend-tooltip-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #17202a;
  font-size: 12px;
}

.trend-tooltip-title time {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--type-support);
  font-variant-numeric: tabular-nums;
}

.trend-tooltip-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--trend-color, var(--total));
}

.trend-tooltip-grid {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 5px 10px;
  margin-top: 9px;
  font-size: 12px;
}

.trend-tooltip-grid span {
  color: var(--muted);
}

.trend-tooltip-grid strong {
  justify-self: end;
  color: #17202a;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .line,
  .trend-hover-layer,
  .trend-tooltip {
    transition-duration: 0.01ms;
  }
}

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

.tree-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(24, 39, 75, 0.035);
  transform: translateY(0);
  transition:
    transform var(--motion-base),
    box-shadow var(--motion-base),
    border-color var(--motion-base),
    background-color var(--motion-base);
}

.tree-card > header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.tree-card h3,
.issue-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.tree-card p,
.issue-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tree-total,
.issue-total {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}

.tree-total strong,
.issue-total strong {
  font-size: 18px;
  line-height: 1.15;
}

.tree-total span,
.issue-total span {
  color: var(--muted);
  font-size: 12px;
}

.group-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.group-block {
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.group-block > header,
.node-row,
.subject-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 96px 72px 58px;
  align-items: center;
  gap: 10px;
}

.group-block > header {
  min-height: 36px;
  padding: 8px 10px;
  background: #f4f7fa;
  color: #2d3745;
  font-size: 12px;
  font-weight: 760;
}

.group-block em,
.node-row em,
.subject-row em {
  color: var(--muted);
  font-size: var(--type-support);
  font-style: normal;
  text-align: right;
}

.group-block b,
.node-row b,
.subject-row b {
  font-size: 12px;
  text-align: right;
}

.node-block {
  border-top: 1px solid #eef2f6;
}

.node-block-compact {
  padding-top: 0;
}

.node-row {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.group-block > header,
.node-row,
.subject-row {
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    transform var(--motion-fast);
}

.node-row:hover,
.subject-row:hover {
  background: #f7fbff;
  transform: translateX(2px);
}

.node-row span,
.subject-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.subject-list {
  display: grid;
  gap: 0;
  padding: 0 10px 8px 22px;
}

.subject-row {
  min-height: 30px;
  padding: 6px 0;
  border-top: 1px dashed #e8eef5;
  color: #3a4654;
  font-size: var(--type-support);
}

.subject-row span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.subject-row i {
  flex: 0 0 auto;
  min-width: 34px;
  border: 1px solid #d7e0ea;
  border-radius: 5px;
  background: #f7fafc;
  color: #536170;
  font-size: var(--type-support);
  font-style: normal;
  line-height: 18px;
  text-align: center;
}

.node-issue-list {
  display: flex;
  padding: 9px 10px 10px 22px;
  background: #fff;
}

.node-issue-list article {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #fbfcfd;
}

.node-issue-list header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.node-issue-list strong {
  color: #172231;
  font-size: 12px;
}

.node-issue-list span {
  color: #536170;
  font-size: var(--type-support);
  white-space: nowrap;
}

.node-issue-list p,
.node-issue-list footer {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-support);
  line-height: 1.45;
}

.node-issue-list footer {
  color: #344252;
}

.drilldown-trigger {
  width: calc(100% - 32px);
  min-height: 34px;
  margin: 0 10px 8px 22px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  background: #f7fafc;
  color: #2f3b48;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  box-shadow: 0 3px 10px rgba(24, 39, 75, 0.035);
  transform: translateY(0);
  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast),
    border-color var(--motion-fast),
    background-color var(--motion-fast);
}

.drilldown-trigger:hover {
  background: #edf4fa;
  border-color: #b9c9d8;
  box-shadow: 0 7px 16px rgba(24, 39, 75, 0.075);
  transform: translateY(-1px);
}

.drilldown-trigger:active {
  transform: translateY(0) scale(0.995);
}

.drilldown-trigger b {
  color: var(--muted);
  font-size: var(--type-support);
  font-weight: 760;
  white-space: nowrap;
}

.drilldown-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 32 / 48%);
}

.drilldown-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(16 24 33 / 28%);
  overflow: hidden;
}

.drilldown-dialog > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.drilldown-dialog h2 {
  margin: 3px 0 0;
  color: #202a35;
  font-size: 18px;
  line-height: 1.3;
}

.drilldown-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.drilldown-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.drilldown-total {
  padding: 12px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  background: #f7fafc;
  border-bottom: 1px solid var(--border);
}

.drilldown-total strong {
  font-size: 20px;
}

.drilldown-total span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.drilldown-subjects {
  overflow: auto;
  padding: 6px 18px 14px;
}

.drilldown-subjects .subject-row {
  grid-template-columns: minmax(180px, 1fr) 112px 80px 72px;
}

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

.issue-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(24, 39, 75, 0.035);
  transform: translateY(0);
  transition:
    transform var(--motion-base),
    box-shadow var(--motion-base),
    border-color var(--motion-base),
    background-color var(--motion-base);
}

.issue-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.issue-card footer {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f4f7fa;
  color: #344252;
  font-size: 12px;
  line-height: 1.45;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--muted);
}

td.empty {
  display: table-cell;
  min-height: 0;
  height: 150px;
  padding: 18px 16px;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

@media (max-width: 1120px) {
  .topbar-main {
    grid-template-columns: var(--nav-topbar-columns);
  }

  .module-tabs {
    grid-column: 1 / -1;
    max-width: none;
  }
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #overviewPanel .trend-panel,
  #overviewPanel .shop-sales-panel {
    grid-column: 1 / -1;
  }

  .profit-controls,
  .profit-summary,
  .ad-cost-grid,
  .creator-commission-grid,
  .ad-cost-filters,
  .ad-drill-grid,
  .refund-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-commission-layout {
    grid-template-columns: 1fr;
  }

  .ad-cost-quality,
  .ad-drill-head {
    align-items: stretch;
    display: grid;
  }

  .profit-option {
    grid-template-columns: minmax(220px, 1fr) repeat(2, auto);
  }

  .profit-option > span:nth-child(4),
  .profit-option > span:nth-child(5) {
    justify-self: start;
  }

  .tree-grid {
    grid-template-columns: 1fr;
  }

  .metric-card.total {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 22px, 1180px);
    padding-top: 12px;
  }

  .section-head,
  .refund-detail-head {
    display: grid;
  }

  .topbar {
    top: 6px;
    padding: 6px;
  }

  .topbar-main {
    display: grid;
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  h1 {
    font-size: 23px;
  }

  .topbar-title {
    min-width: 0;
    gap: 8px;
  }

  .topbar-title::before {
    width: 64px;
    height: 34px;
  }

  .controls {
    justify-content: stretch;
  }

  .module-tabs {
    margin: 0 -2px;
    flex-wrap: nowrap;
    max-width: none;
  }

  .module-tabs a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 6px;
  }

  .platform-switch a {
    min-height: 22px;
    padding: 0 9px;
    font-size: var(--type-support);
  }

  .meta-line span {
    width: 100%;
  }

  label,
  input,
  button {
    width: 100%;
  }

  .topbar .controls {
    align-items: end;
    justify-content: flex-start;
    gap: 6px;
  }

  .topbar .controls label {
    flex: 1 1 148px;
    width: auto;
    min-width: 0;
  }

  .topbar .controls input {
    width: 100%;
  }

  .topbar .controls button {
    flex: 0 0 auto;
    width: auto;
    min-width: 88px;
  }

  button.ghost {
    width: calc(50% - 3px);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .profit-controls,
  .profit-summary,
  .ad-cost-grid,
  .creator-commission-grid,
  .ad-cost-filters,
  .ad-drill-grid,
  .refund-detail-summary {
    grid-template-columns: 1fr;
  }

  .profit-option {
    grid-template-columns: 1fr;
  }

  .profit-option > span:nth-child(n+2) {
    justify-self: start;
  }

  .metric-card.total {
    grid-column: auto;
  }

  .chart-frame {
    height: 300px;
  }

  .tree-card > header,
  .issue-card header {
    display: grid;
  }

  .tree-total,
  .issue-total {
    justify-items: start;
    text-align: left;
  }

  .group-block > header,
  .node-row,
  .subject-row {
    grid-template-columns: minmax(0, 1fr) 84px 58px;
  }

  .group-block > header em,
  .node-row em:last-child,
  .subject-row em:last-child {
    display: none;
  }

  .subject-list {
    padding-left: 12px;
  }

  .drilldown-trigger {
    width: calc(100% - 22px);
    margin-left: 12px;
    grid-template-columns: minmax(0, 1fr);
  }

  .drilldown-overlay {
    padding: 12px;
    place-items: end center;
  }

  .drilldown-dialog {
    max-height: calc(100vh - 24px);
  }

  .drilldown-dialog > header,
  .drilldown-total {
    display: grid;
  }

  .drilldown-total span {
    text-align: left;
  }

  .drilldown-subjects .subject-row {
    grid-template-columns: minmax(0, 1fr) 84px 58px;
  }
}

/* Dashboard field contract: labels and metric values stay on one line.
   Long business names are clipped with an ellipsis; wide tables scroll inside their panel. */
.dashboard-app :where(
  .rail-brand b,
  .rail-brand small,
  .platform-rail a span:last-child,
  .platform-rail a small,
  .topbar-title h1,
  .module-tabs a span:last-child,
  .section-head h2,
  .section-head p,
  .status-meta-strip .meta-line span,
  .metric-card h3,
  .metric-card strong,
  .metric-card dt,
  .metric-card dd,
  .metric-card .status,
  .metric-card .field-status,
  .metric-card .zero-note,
  .tree-card h3,
  .tree-card strong,
  .tree-card span,
  .tree-card small,
  .tree-card dt,
  .tree-card dd,
  .tree-total span,
  .tree-total strong,
  .issue-card h3,
  .issue-card strong,
  .issue-card span,
  .issue-card small,
  .issue-total span,
  .issue-total strong,
  .group-block > header span,
  .group-block > header strong,
  .group-block > header em,
  .node-row span,
  .node-row strong,
  .node-row em,
  .subject-row span,
  .subject-row strong,
  .subject-row em,
  .drilldown-trigger span,
  .drilldown-trigger strong,
  .drilldown-total span,
  .drilldown-total strong,
  .profit-option b,
  .profit-option small,
  .profit-option > span,
  .profit-kpi span,
  .profit-kpi strong,
  .profit-kpi small,
  .ad-drill-grid span,
  .ad-drill-grid small,
  .ad-drill-grid b,
  .creator-commission-money,
  .creator-commission-rate,
  .creator-commission-meta,
  .creator-commission-status-note,
  .state-pill
) {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.dashboard-app :where(
  .metric-card header,
  .metric-card dl > div,
  .tree-card > header,
  .issue-card header,
  .group-block > header,
  .node-row,
  .subject-row,
  .drilldown-trigger,
  .profit-option,
  .profit-kpi,
  .creator-commission-meta
) {
  min-width: 0;
}

.dashboard-app :where(
  table th,
  table td,
  .profit-table th,
  .profit-table td,
  .schedule-table th,
  .schedule-table td
) {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.dashboard-app :where(
  .table-wrap,
  .profit-table-wrap,
  .creator-commission-table-wrap,
  .schedule-table-wrap,
  .schedule-table-shell
) {
  overflow-x: auto;
}

.skeleton {
  display: block;
  background-color: var(--skeleton-base);
  background-image: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 37%, var(--skeleton-base) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 6px;
  overflow: hidden;
  line-height: 1;
  color: transparent;
}

.skeleton-field,
.skeleton-pill,
.skeleton-table-cell {
  display: block;
  background-color: var(--skeleton-base);
  background-image: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 37%, var(--skeleton-base) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  overflow: hidden;
  color: transparent;
}

.skeleton-line {
  height: 12px;
}

.skeleton-strong {
  height: 24px;
}

.skeleton-bar {
  height: 4px;
  border-radius: 999px;
}

.skeleton-row {
  height: 18px;
  margin: 4px 0;
}

.skeleton-field {
  height: 14px;
  border-radius: 6px;
}

.skeleton-pill {
  height: 22px;
  border-radius: 999px;
}

.skeleton-table-cell {
  height: 18px;
  margin: 4px 0;
  border-radius: 6px;
}

.skeleton-chart {
  color: var(--skeleton-line);
}

.skeleton-chart-axis,
.skeleton-chart-line {
  fill: none;
  stroke: var(--skeleton-line);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skeleton-chart-axis {
  stroke-width: 1;
  stroke-dasharray: 4 8;
}

.skeleton-chart-bars rect,
.skeleton-chart-bar {
  fill: var(--skeleton-block);
}

.skeleton-chart-donut {
  fill: none;
  stroke: var(--skeleton-block);
  stroke-linecap: round;
}

.skeleton-tree,
.skeleton-issue {
  display: grid;
  gap: 9px;
}

.metric-card.skeleton-card {
  border-left-color: var(--skeleton-border);
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .skeleton-field,
  .skeleton-pill,
  .skeleton-table-cell {
    background-image: none !important;
  }
}
