:root {
  color-scheme: light;
  --ink: #1b2430;
  --muted: #667085;
  --line: #d9e1e8;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --blue: #2364aa;
  --jd-red: #d71920;
  --green: #0f9f6e;
  --orange: #f28c28;
  --red: #d64545;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: #edf2f7;
}
.auth-gate.visible { display: grid; }
.auth-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid #d7e1ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 23, 34, 0.12);
}
.auth-card .eyebrow { margin: 0 0 8px; }
.auth-card h1 { margin: 0 0 8px; font-size: 28px; }
.auth-card p { margin: 0 0 22px; color: var(--muted); }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.auth-form button { min-height: 42px; }
.auth-error { min-height: 18px; margin: 0; color: var(--jd-red); font-size: 13px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  background: var(--paper);
  transition: grid-template-columns 0.2s ease;
}

.user-session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}
.secondary-action {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.secondary-action:hover { border-color: var(--blue); background: #f4f8ff; }

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  padding: 14px 8px;
  background: #101722;
  color: #d7deea;
  transition: padding 0.2s ease;
  z-index: 30;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #101722;
  z-index: -1;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-left: 0;
  padding-right: 0;
}

.app-shell.sidebar-collapsed .brand,
.app-shell.sidebar-collapsed .nav-search,
.app-shell.sidebar-collapsed .nav-menu {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar::before {
  display: none;
}

.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e0eb;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(16, 23, 34, 0.16);
  cursor: pointer;
  z-index: 40;
}

.sidebar-toggle:hover {
  border-color: var(--blue);
  background: #f4f8ff;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  right: -46px;
}

.brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

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

.brand strong { font-size: 16px; }

.brand small {
  margin-top: 3px;
  color: #8c98aa;
  font-size: 11px;
}

.nav-search {
  margin: 16px 0 12px;
  display: grid;
  gap: 7px;
  color: #8c98aa;
  font-size: 12px;
}

.nav-search input {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.1);
  background: #182230;
  color: #fff;
}

.nav-search input::placeholder {
  color: #7e8999;
}

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

.nav-group-toggle,
.nav-link,
.nav-main-link {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-group-toggle {
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 12px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 6px;
  color: #eef3fb;
  font-size: 13px;
  font-weight: 700;
}

.nav-main-link {
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 6px;
  color: #eef3fb;
  font-size: 13px;
  font-weight: 700;
}

.nav-main-link > span:nth-child(2) { white-space: nowrap; }
.nav-main-link:hover { background: #172235; }
.nav-main-link.active { background: rgba(215, 25, 32, 0.18); color: #fff; }

.nav-group-toggle > span:nth-child(2) {
  white-space: nowrap;
}

.nav-group-toggle:hover,
.nav-group.open .nav-group-toggle {
  background: #172235;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #8fb9ff;
  font-size: 12px;
  font-weight: 800;
}

.hot {
  min-width: 32px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--jd-red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.hot.blue {
  background: var(--blue);
}

.nav-group-toggle i {
  width: 7px;
  height: 7px;
  border-right: 2px solid #728096;
  border-bottom: 2px solid #728096;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.nav-group.open .nav-group-toggle i {
  transform: rotate(45deg);
}

.nav-submenu {
  display: none;
  padding: 4px 0 8px 24px;
}

.nav-group.open .nav-submenu {
  display: grid;
  gap: 4px;
}

.nav-link {
  min-height: 34px;
  padding: 0 10px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: #9da8b8;
  font-size: 12px;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  border-left-color: var(--jd-red);
  background: rgba(215, 25, 32, 0.18);
  color: #fff;
}

.nav-subgroup { display: grid; gap: 3px; }
.nav-subgroup-toggle {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d7deea;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.nav-subgroup-toggle:hover { background: rgba(255, 255, 255, .05); }
.nav-subgroup-toggle i {
  width: 7px;
  height: 7px;
  border-right: 2px solid #728096;
  border-bottom: 2px solid #728096;
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.nav-subgroup.open .nav-subgroup-toggle i { transform: rotate(45deg); }
.nav-thirdmenu { display: none; margin-left: 10px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .12); }
.nav-subgroup.open .nav-thirdmenu { display: grid; gap: 3px; }
.nav-thirdmenu .nav-link { padding-left: 14px; }

.nav-group.hidden-by-search,
.nav-link.hidden-by-search,
.nav-main-link.hidden-by-search {
  display: none;
}

.content-shell {
  min-width: 0;
  background: #fff;
}

.page-view {
  display: none;
  min-height: 100vh;
  background: var(--paper);
  opacity: 0;
  transform: translateY(8px);
}

.page-view.active {
  display: block;
  animation: page-fade-in 0.2s ease forwards;
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.placeholder-panel {
  min-height: calc(100vh - 48px);
  margin: 24px;
  padding: 28px;
  border: 1px dashed #c8d4df;
  border-radius: 8px;
  background: #fff;
}

.placeholder-panel h1 {
  font-size: 24px;
}

.placeholder-panel p {
  margin: 10px 0 0;
  color: var(--muted);
}

.page-main,
.subpage {
  padding: 28px 40px 44px;
}

.page-head,
.subpage-head {
  min-height: 92px;
  margin-bottom: 16px;
}

.page-head {
  display: grid;
  align-content: center;
}

.page-head p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.subpage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-head h2,
.subpage-head h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.primary-action {
  min-width: 104px;
  height: 38px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.table-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tall-chart {
  height: 420px;
}

.warning-list {
  max-height: 330px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.warning-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  background: #fff7ed;
  color: #7a3d00;
}

.warning-item.critical {
  border-color: var(--red);
  background: #fff1f1;
  color: #9f2525;
}

.warning-item strong {
  font-size: 14px;
}

.warning-item span,
.empty-state {
  color: var(--muted);
  font-size: 13px;
}

.empty-module {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.empty-module[hidden],
.table-panel[hidden] {
  display: none !important;
}

.recharge-filter-bar {
  display: grid;
  grid-template-columns: 200px 200px 150px 180px 96px 244px;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.recharge-filter-bar > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.recharge-filter-bar > label input {
  min-width: 0;
}

.recharge-filter-bar .multi-select-trigger {
  height: 40px;
}

.recharge-type-select .multi-select-menu,
.recharge-sales-select .multi-select-menu {
  left: 0;
  right: auto;
  width: 180px;
  min-width: 180px;
  max-height: 260px;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 4px;
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.recharge-sales-select .multi-select-menu {
  width: 220px;
  min-width: 220px;
}

.recharge-type-select.open .multi-select-menu,
.recharge-sales-select.open .multi-select-menu {
  display: grid;
}

.recharge-type-select .multi-select-option:first-child,
.recharge-sales-select .multi-select-option:first-child {
  grid-column: 1 / -1;
  min-height: 36px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-weight: 700;
}

.recharge-type-select .multi-select-option,
.recharge-sales-select .multi-select-option {
  min-width: 0;
  padding: 6px 8px;
  white-space: nowrap;
}

.recharge-filter-bar .primary-action {
  width: 96px;
}

.recharge-quick-ranges {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 244px;
  min-height: 40px;
  white-space: nowrap;
}

.recharge-quick-ranges button {
  flex: 1 1 0;
  height: 40px;
  min-width: 0;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  cursor: pointer;
}

.recharge-quick-ranges button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.recharge-summary-grid {
  margin-bottom: 14px;
}

.recharge-kpi {
  min-height: 116px;
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 20px;
}

.recharge-kpi span,
.recharge-kpi small {
  color: var(--muted);
}

.recharge-kpi strong {
  color: var(--ink);
  font-size: 30px;
}

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

  .recharge-quick-ranges { grid-column: 1 / -1; }
}

.filters.global-filters {
  grid-template-columns: 140px minmax(160px, 210px) minmax(140px, 180px) 138px 138px auto;
  align-items: end;
  justify-content: start;
  gap: 8px;
  margin: 10px 32px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.kpi-panel .panel-head {
  align-items: flex-start;
}

.kpi-panel .panel-head > .global-filters {
  flex: 0 1 930px;
  width: 930px;
  max-width: calc(100% - 150px);
  margin: -8px 0 -8px 18px;
  padding: 0;
  border: 0;
  background: transparent;
  grid-template-columns: 112px 180px 150px 128px 128px auto;
}

.kpi-panel .panel-head > .global-filters.sales-scoped {
  flex-basis: 750px;
  width: 750px;
  grid-template-columns: 112px 150px 128px 128px minmax(180px, 1fr);
}

.kpi-panel .panel-head > .global-filters label {
  min-width: 0;
}

.global-filters label { gap: 4px; font-size: 11px; }
.global-filters input,
.global-filters select,
.global-filters .multi-select-trigger { height: 34px; }

.metric-notes {
  margin: 8px 32px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.metric-notes summary {
  padding: 9px 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.metric-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 18px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.metric-notes-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.metric-notes-grid strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.quick-range-group {
  display: flex;
  gap: 8px;
  align-items: end;
}

.quick-range-group button {
  white-space: nowrap;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #c8d4df;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.global-alerts {
  margin: 16px 32px 0;
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.global-alerts .alert-summary {
  flex: 1;
}

.alert-jump {
  min-width: 92px;
  border: 1px solid var(--jd-red);
  border-radius: 6px;
  background: var(--jd-red);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.floating-export {
  position: sticky;
  bottom: 18px;
  float: right;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--jd-red);
  border-radius: 6px;
  background: var(--jd-red);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(215, 25, 32, 0.22);
}

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

.target-card {
  min-height: 128px;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.target-card span,
.target-card small {
  color: var(--muted);
}

.target-card strong {
  font-size: 30px;
}

.risk-row {
  background: #fff1f1;
}

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

.sop-list span,
.timeline span {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  font-weight: 700;
}

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

.topbar {
  min-height: 92px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

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

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(24px, 4vw, 36px); }
h2 { font-size: 16px; margin-bottom: 14px; }

.actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.action-buttons { display: flex; gap: 10px; }
.actions button {
  min-width: 86px;
  height: 38px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.actions button:nth-child(2) { background: #fff; color: var(--blue); }
.last-sync-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.filters {
  padding: 10px 32px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) minmax(180px, 0.9fr);
  gap: 12px;
  background: #eef3f7;
  border-bottom: 1px solid var(--line);
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.filter-wide { align-content: start; }
input, select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}
select[multiple] {
  height: 86px;
  padding: 6px 10px;
}
.filter-buttons {
  min-height: 38px;
  max-height: 96px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.filter-scroll { max-height: 122px; }
.filter-chip {
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #c8d4df;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.multi-select {
  position: relative;
  min-width: 0;
}
.multi-select-trigger {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}
.multi-select-trigger::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  flex: 0 0 auto;
}
.multi-select.open .multi-select-trigger::after {
  border-top: 0;
  border-bottom: 6px solid var(--muted);
}
.multi-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow: auto;
  display: none;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(27, 36, 48, 0.14);
}
.multi-select.open .multi-select-menu {
  display: block;
}
.multi-select-option {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.multi-select-option:hover {
  background: #eef3f7;
}
.multi-select-option input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: 0 0 auto;
}

main { padding: 22px 32px 40px; }
.overview-main { padding-top: 16px; }
.overview-head {
  min-height: 48px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.overview-head h2 { margin-bottom: 0; }
.overview-head > p { margin: 0; color: var(--muted); font-size: 12px; }
.alerts { display: block; margin-bottom: 12px; }
.alert {
  padding: 12px 14px;
  border-left: 4px solid var(--orange);
  background: #fff7ed;
  border-radius: 6px;
  color: #7a3d00;
  font-weight: 700;
}
.alert.critical { border-color: var(--red); background: #fff1f1; color: #9f2525; }
.alert-summary {
  border-left: 4px solid var(--orange);
  border-radius: 6px;
  background: #fff7ed;
  color: #7a3d00;
  font-weight: 700;
}
.alert-summary.critical {
  border-color: var(--red);
  background: #fff1f1;
  color: #9f2525;
}
.alert-summary summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  cursor: pointer;
}
.alert-summary summary span {
  flex: 0 0 auto;
}
.alert-summary summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.alert-list {
  max-height: 220px;
  overflow: auto;
  padding: 0 14px 10px 14px;
}
.alert-line {
  padding: 7px 0;
  border-top: 1px solid rgba(214, 69, 69, 0.12);
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.kpi, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.kpi { padding: 12px 14px; display: grid; grid-template-rows: auto auto auto 20px; gap: 3px; min-height: 112px; }
.kpi:nth-child(-n + 3),
.kpi:nth-child(n + 4) { grid-column: auto; }
.kpi:nth-child(1) { background: #f4f8fe; border-color: #d6e3f6; }
.kpi:nth-child(2) { background: #f2faf7; border-color: #cfe8dc; }
.kpi:nth-child(3) { background: #faf8f2; border-color: #ece0c3; }
.kpi:nth-child(4) { background: #f5f9fc; border-color: #d8e4ed; }
.kpi:nth-child(5) { background: #fff8f2; border-color: #f1dcc7; }
.kpi:nth-child(6) { background: #fff5f5; border-color: #f0d0d0; }
.kpi:nth-child(7) { background: #f3fafb; border-color: #cfe5e7; }
.kpi:nth-child(8) { background: #f8f7f3; border-color: #e4dfd1; }
.kpi span, .kpi small { color: var(--muted); }
.kpi strong { display: flex; align-items: baseline; gap: 6px; font-size: clamp(20px, 2.2vw, 28px); }
.kpi-trend-arrow { font-size: 28px; font-weight: 900; line-height: 1; animation: kpi-trend-pulse 1.5s ease-in-out infinite; }
.kpi-trend-arrow.trend-up { color: var(--jd-red); }
.kpi-trend-arrow.trend-down { color: var(--green); }
.kpi-trend-arrow.trend-flat { color: var(--muted); }

@keyframes kpi-trend-pulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-3px); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-trend-arrow { animation: none; }
}
.kpi-detail-btn {
  align-self: end;
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.kpi-detail-btn::after { content: " ›"; }
.kpi-detail-btn:hover { color: var(--jd-red); }

.kpi-detail-dialog {
  width: min(1080px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(16, 23, 34, 0.28);
}
.kpi-detail-dialog::backdrop { background: rgba(16, 23, 34, 0.55); }
.account-dialog {
  width: min(940px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(16, 23, 34, 0.28);
}
.account-dialog::backdrop { background: rgba(16, 23, 34, 0.55); }
.account-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.account-dialog-head h2 { margin: 0; font-size: 20px; }
.account-dialog-main { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; padding: 20px 22px; }
.account-dialog-main h3 { margin: 0 0 12px; font-size: 15px; }
.account-user-form { display: grid; gap: 10px; }
.account-user-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.account-user-form button { min-height: 38px; }
.account-dialog .table-wrap { max-height: 500px; }
.account-dialog table { width: 100%; min-width: 520px; }
.account-dialog td:last-child { text-align: right; }
.account-status { color: var(--muted); font-size: 12px; }
.kpi-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.kpi-dialog-head h2 { margin: 4px 0 0; font-size: 22px; }
.dialog-eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; }
.dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:hover { border-color: var(--jd-red); color: var(--jd-red); }
.kpi-dialog-summary {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 14px 22px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.kpi-dialog-summary strong { font-size: 24px; }
.kpi-dialog-summary span { color: var(--muted); font-size: 13px; }
.kpi-detail-table-wrap { max-height: 540px; }
.kpi-detail-table-wrap table { width: max-content; min-width: 880px; table-layout: fixed; }
.kpi-detail-table-wrap th:first-child,
.kpi-detail-table-wrap td:first-child { padding-left: 22px; }
.kpi-detail-table-wrap .kpi-col-customerName {
  width: 210px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-detail-table-wrap .kpi-col-customerId { width: 120px; }
.kpi-detail-table-wrap .kpi-col-customerType { width: 76px; }
.kpi-detail-table-wrap .kpi-col-sales { width: 116px; }
.kpi-detail-table-wrap .kpi-col-industry { width: 130px; }
.kpi-detail-table-wrap .kpi-col-spend,
.kpi-detail-table-wrap .kpi-col-latestSpend,
.kpi-detail-table-wrap .kpi-col-balance { width: 132px; text-align: right; }
.kpi-detail-table-wrap .kpi-col-supportMonths,
.kpi-detail-table-wrap .kpi-col-yoy { width: 112px; text-align: right; }
.kpi-detail-table-wrap .kpi-col-newStatus,
.kpi-detail-table-wrap .kpi-col-retentionStatus { width: 104px; }
.empty-detail { height: 180px; text-align: center; color: var(--muted); }

.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 14px 16px; min-width: 0; }
.kpi-panel { margin-bottom: 10px; }
.overview-charts { gap: 10px; margin-bottom: 10px; }
.overview-trends { margin-bottom: 10px; }
.section-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 10px;
}
.section-label h2 { margin: 0; }
.section-label > p { margin: 0; color: var(--muted); font-size: 12px; }
.trend-panel-wide { margin-bottom: 10px; }
.trend-panel .chart { height: 270px; }
.chart-panel .panel-head { margin-bottom: 4px; }
.chart-panel .panel-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { margin-bottom: 0; }
.module-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.module-filter input {
  width: 132px;
  height: 32px;
  padding: 0 8px;
}
.module-filter button {
  height: 32px;
  border: 1px solid #c8d4df;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.chart { width: 100%; height: 250px; }

.table-wrap { overflow: auto; max-height: 520px; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ledger-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 2px;
  border: 0 !important;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.ledger-sort-button:hover { color: var(--blue); background: #eaf3ff; }
.ledger-sort-button:focus-visible { outline: 2px solid #91caff; outline-offset: 2px; }
.ledger-sort-button .sort-indicator { color: #a8b4c5; font-size: 11px; font-weight: 800; }
.ledger-sort-button.active { color: var(--blue); }
.ledger-sort-button.active .sort-indicator { color: currentColor; }
.customer-ledger-table {
  table-layout: fixed;
  min-width: 1400px;
}
.customer-ledger-table th:first-child,
.customer-ledger-table td:first-child {
  width: 160px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.balance-channel-detail { min-width: 260px; white-space: normal; line-height: 1.7; }
.balance-channel-detail span { display: inline-block; }
.balance-channel-detail i { margin: 0 5px; color: var(--muted); font-style: normal; }
.merchant-status-panel { margin-bottom: 14px; }
.merchant-status-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.merchant-status-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.merchant-status-form select,
.merchant-status-form input { min-width: 155px; height: 38px; padding: 0 10px; }
.merchant-status-form input { width: 280px; }
.merchant-status-form button { height: 38px; }
.merchant-status-hint { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.merchant-status-table-wrap table { min-width: 1280px; }
.global-alerts,
.metric-notes { display: none; }
body.dashboard-context .global-alerts { display: flex; }
body.dashboard-context .metric-notes { display: block; }
.case-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.case-page-heading .page-head { flex: 1; }
.case-breadcrumb { color: var(--blue) !important; font-size: 12px; font-weight: 700; }
.case-upload-button { margin-bottom: 22px; }
.case-library-toolbar { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(130px, 1fr)); align-items: end; gap: 12px; }
.case-library-toolbar label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.case-library-toolbar .case-search { min-width: 0; }
.case-library-toolbar input,
.case-library-toolbar select { width: 100%; height: 40px; padding: 0 11px; }
.case-library-toolbar [hidden],
.case-classification-fields[hidden],
.case-classification-fields [hidden],
.case-library-table [hidden] { display: none !important; }
.case-library-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 2px 10px; color: var(--muted); font-size: 13px; }
.case-sync-status { color: var(--green); font-weight: 700; }
.case-sync-status::before { content: "✓"; display: inline-grid; width: 18px; height: 18px; place-items: center; margin-right: 6px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; }
.case-library-table-panel { padding: 0; overflow: hidden; }
.case-library-table-panel .table-wrap { max-height: none; }
.case-library-table { min-width: 1180px; }
.case-library-table th,
.case-library-table td { padding: 14px 12px; }
.case-library-table td:not(:last-child) { text-align: left; }
.case-file-name { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.case-file-name > div { min-width: 0; }
.case-file-name strong,
.case-file-name small { display: block; }
.case-file-name strong { max-width: 320px; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.case-file-name small { max-width: 320px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.case-taxonomy-path { min-width: 108px; }
.case-taxonomy-path strong,
.case-taxonomy-path span { display: block; white-space: nowrap; }
.case-taxonomy-path strong { color: var(--ink); font-size: 12px; }
.case-taxonomy-path span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.case-delivery-tag { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; background: #eef4ff; color: #175cd3; font-size: 11px; font-weight: 700; white-space: nowrap; }
.case-delivery-onsite { background: #ecfdf3; color: #027a48; }
.case-delivery-offsite-pin { background: #fff6ed; color: #c4320a; }
.case-delivery-onsite-offsite-pin { background: #f4f3ff; color: #5925dc; }
.case-delivery-uncategorized { background: #f2f4f7; color: #667085; }
.case-file-type { min-width: 42px; height: 28px; display: inline-grid; place-items: center; border-radius: 5px; background: #eef4ff; color: var(--blue); font-size: 10px; font-weight: 800; }
.case-file-pdf { background: #fff0f0; color: #d92d20; }
.case-file-ppt,
.case-file-pptx { background: #fff3e8; color: #c94b16; }
.case-file-xls,
.case-file-xlsx { background: #eaf8f0; color: #16835b; }
.case-description-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.case-row-actions { display: flex; align-items: center; gap: 10px; }
.case-row-actions a { text-decoration: none; }
.text-action.danger { color: var(--jd-red); }
.case-file-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(16, 23, 34, .28);
}
.case-file-dialog::backdrop { background: rgba(16, 23, 34, .55); }
.case-file-form { display: grid; gap: 15px; padding: 20px 22px 22px; }
.case-classification-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.case-classification-fields label:last-child { grid-column: 1 / -1; }
.case-new-category-field input { border-color: #84adff; background: #f5f8ff; }
.case-file-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.case-file-form input,
.case-file-form select,
.case-file-form textarea { width: 100%; padding: 10px 11px; font: inherit; }
.case-file-form input,
.case-file-form select { min-height: 40px; }
.case-file-form textarea { resize: vertical; }
.case-file-form small { color: var(--muted); font-weight: 400; }
.case-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.case-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.case-library-section-title { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin: 10px 0 -2px; }
.case-library-section-title h3 { margin: 0; font-size: 16px; }
.case-library-section-title span { color: var(--muted); font-size: 12px; }
.case-card { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.case-card .eyebrow { margin-bottom: 8px; }
.case-card h3 { margin: 0 0 10px; font-size: 18px; }
.case-card > p { margin: 0; color: var(--muted); line-height: 1.7; }
.case-card dl { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.case-card dt { color: var(--ink); font-size: 12px; font-weight: 800; }
.case-card dd { margin: 6px 0 0; color: var(--muted); line-height: 1.65; }
.case-material-card { display: flex; min-height: 148px; flex-direction: column; align-items: flex-start; }
.case-material-card .case-source { margin-bottom: 16px; }
.case-material-card .secondary-action { margin-top: auto; text-decoration: none; }
th { position: sticky; top: 0; background: #f8fafc; font-size: 12px; color: var(--muted); }
.table-filter-row th {
  top: 40px;
  padding: 6px 8px;
  background: #eef3f7;
}
.table-filter-row input,
.table-filter-row select {
  width: 100%;
  min-width: 86px;
  height: 30px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 400;
}
.table-filter-row th:empty::after {
  content: "-";
  color: transparent;
}
td.negative { color: var(--red); font-weight: 700; }
td.positive { color: var(--green); font-weight: 700; }

/* r14 dashboard visual system: dense B-end information, clear hierarchy. */
:root { --blue: #246bce; --paper: #f6f8fb; --ink: #101828; --line: #e4e7ec; --sidebar: #101828; }
.app-shell { grid-template-columns: 240px minmax(0, 1fr); background: var(--paper); }
.app-shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar, .sidebar::before { background: var(--sidebar); }
.sidebar { padding: 18px 12px; }
.brand { height: 64px; padding: 0 8px 16px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--blue); }
.nav-search { margin: 18px 0 12px; }
.nav-search input { border-color: #344054; background: #1d2939; color: #f8fafc; }
.nav-group-toggle, .nav-main-link { border-radius: 8px; }
.nav-link { position: relative; border-radius: 6px; color: #b9c3d4; }
.nav-link.active, .nav-main-link.active { background: rgba(36, 107, 206, .16); color: #fff; }
.nav-link.active::before, .nav-main-link.active::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: #2e90fa; }
.content-shell { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 104px; padding: 22px 34px 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.topbar h1 { letter-spacing: -.8px; }
.topbar .actions { align-items: flex-end; }
.page-main, main { padding-left: 34px; padding-right: 34px; }
.global-alerts { margin: 18px 34px 0; }
.metric-notes, .global-filters { margin-left: 34px; margin-right: 34px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.filters.global-filters { padding: 16px 18px; border-radius: 12px; }
.panel { border-color: var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.page-head { margin-top: 28px; }
.kpi-panel { background: transparent; border: 0; box-shadow: none; padding: 0; }
.kpi-grid { gap: 12px; }
.kpi { min-height: 148px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid #98a2b3; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.kpi:nth-child(1) { border-top-color: #246bce; }.kpi:nth-child(2) { border-top-color: #12b76a; }.kpi:nth-child(3) { border-top-color: #f79009; }.kpi:nth-child(4) { border-top-color: #2e90fa; }.kpi:nth-child(5) { border-top-color: #fdb022; }.kpi:nth-child(6) { border-top-color: #ee46bc; }.kpi:nth-child(7) { border-top-color: #06aed4; }.kpi:nth-child(8) { border-top-color: #7a5af8; }
.kpi strong { color: #101828; }.kpi-detail-btn { padding-left: 0; }
.alert-summary { width: 100%; border: 1px solid #fed7d7; border-left: 4px solid #f04438; background: #fffafa; border-radius: 10px; }
.alert-summary summary { min-height: 54px; }.alert-list { padding: 0 16px 14px; }.alert-line { padding: 8px 0; border-top: 1px solid #fee4e2; }.alert-jump { background: #f04438; border-radius: 8px; }
.table-wrap { border-radius: 10px; border: 1px solid var(--line); }
table { min-width: 900px; } th { z-index: 2; background: #f9fafb; border-bottom: 1px solid var(--line); color: #475467; } th:first-child, td:first-child { position: sticky; left: 0; z-index: 1; background: inherit; } th:first-child { z-index: 3; } td:first-child { background: #fff; font-weight: 700; } td { border-bottom-color: #eaecf0; } td:not(:first-child) { text-align: right; } td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6) { text-align: left; }
.merchant-status-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; align-items: stretch; }
.merchant-status-form { display: grid; grid-template-columns: 190px minmax(280px, 1fr) 128px; align-items: end; gap: 12px; }
.merchant-quota-card { display: grid; gap: 8px; padding: 16px; border: 1px solid #b2ddff; border-radius: 10px; background: #eff8ff; }.merchant-quota-card span { color: #475467; font-size: 13px; }.merchant-quota-card strong { font-size: 28px; color: #175cd3; }.merchant-quota-track { height: 8px; overflow: hidden; background: #d1e9ff; border-radius: 999px; }.merchant-quota-track i { display: block; width: 0; height: 100%; background: #246bce; transition: width .2s ease; }.text-action { border: 0; padding: 0; background: transparent; color: #246bce; font-weight: 700; cursor: pointer; text-align: left; }
.merchant-status-hint { margin: 14px 0 0; color: #475467; }
button:disabled { cursor: not-allowed; opacity: .52; filter: grayscale(.2); }
.consumption-filter-host > .global-filters { width: 100%; margin: 0 0 16px; }
.consumption-summary-panel { margin-bottom: 20px; }
.consumption-summary-panel .panel-head small { display: block; margin-top: 5px; color: var(--muted); }
.consumption-notice { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #b2ddff; border-radius: 8px; background: #eff8ff; color: #175cd3; }
.consumption-notice.warning { border-color: #fedf89; background: #fffaeb; color: #b54708; }
.consumption-channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 10px; }
.consumption-channel-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f9fafb; }
.consumption-channel-card span, .consumption-channel-card small { display: block; color: var(--muted); }
.consumption-channel-card span { min-height: 34px; font-size: 12px; }
.consumption-channel-card strong { display: block; margin: 5px 0 2px; overflow-wrap: anywhere; color: var(--ink); font-size: 23px; line-height: 1.15; }
.consumption-channel-card small { font-size: 11px; }
.consumption-table { min-width: 2500px; }
.consumption-table th:nth-child(n + 6), .consumption-table td:nth-child(n + 6) { text-align: right; }
.consumption-table-panel .table-wrap { max-height: 660px; }
.consumption-table-head { align-items: flex-end; gap: 16px; }
.consumption-table-head > div:first-child { min-width: 170px; }
.consumption-table-head .table-count { display: block; margin-top: 5px; }
.douyin-search-panel { margin-bottom: 18px; }
.douyin-search-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.douyin-search-row label { flex: 1 1 420px; display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.douyin-search-row input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.douyin-status { color: #b54708; font-size: 12px; }.douyin-status.ready { color: #079455; }
.collector-control-panel { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; margin-bottom:16px; }
.collector-control-panel > div { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.collector-server-status { color:#8a94a7; font-size:13px; }
.collector-server-status.ready { color:#159467; }
.collector-admin-controls { display:flex; align-items:center; gap:10px; }
.collector-pair-code { padding:8px 11px; border:1px dashed #2b70d6; border-radius:8px; color:#1559bb; background:#f3f8ff; font-weight:700; user-select:all; }
.douyin-search-results { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 10px; margin-top: 14px; }
.douyin-result { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
.douyin-result:hover { border-color: #2e90fa; background: #eff8ff; }.douyin-result strong,.douyin-result span { display:block; }.douyin-result span { margin-top:5px;color:var(--muted);font-size:12px; }
.buyin-result { cursor: default; display: grid; gap: 6px; }
.buyin-result .buyin-collect { width: 100%; margin-top: 6px; }
.buyin-leads-head { gap: 14px; align-items: flex-end; }
.buyin-list-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.buyin-list-actions input { width: min(360px, 70vw); height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.buyin-leads-panel table { min-width: 1480px; }
.sensitive-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty-cell { text-align: center; color: var(--muted); padding: 36px 12px !important; }
.douyin-period-panel { display:flex;align-items:center;gap:16px;margin-bottom:14px; }.douyin-period-panel>div:first-child { display:grid;gap:4px; }.douyin-period-panel small { color:var(--muted); }
.douyin-periods { display:flex;gap:7px;margin-left:auto; }.douyin-periods button { padding:8px 12px;border:1px solid var(--line);border-radius:7px;background:#fff;cursor:pointer; }.douyin-periods button.active { color:#fff;background:#246bce;border-color:#246bce; }
.douyin-kpis { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px; }.douyin-kpis article span,.douyin-kpis article small { display:block;color:var(--muted); }.douyin-kpis article strong { display:block;margin:8px 0;font-size:28px; }
@media (max-width: 900px) { .douyin-kpis{grid-template-columns:1fr 1fr}.douyin-period-panel{align-items:flex-start;flex-direction:column}.douyin-periods{margin-left:0;flex-wrap:wrap} }
.consumption-table-filters { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; margin-left: auto; }
.consumption-table-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.consumption-table-filters input,
.consumption-table-filters select { height: 38px; min-width: 180px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; }
.consumption-table-filters input { min-width: 240px; }
.consumption-table-filters .secondary-action { height: 38px; }

@media (min-width: 1440px) { .kpi { min-height: 154px; } }
@media (min-width: 1024px) and (max-width: 1439px) { .app-shell { grid-template-columns: 208px minmax(0, 1fr); }.topbar, .page-main, main { padding-left: 26px; padding-right: 26px; }.global-alerts, .metric-notes, .global-filters { margin-left: 26px; margin-right: 26px; }.merchant-status-layout { grid-template-columns: 1fr; }.merchant-quota-card { grid-template-columns: auto 1fr; align-items: center; }.merchant-quota-track { grid-column: 1 / -1; } }

@media (min-width: 981px) and (max-width: 1439px) {
  .case-library-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-library-toolbar .case-search { grid-column: span 3; }
}

@media (max-width: 980px) {
  .app-shell,
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }
  .sidebar-toggle { top: 14px; right: 14px; }
  .app-shell.sidebar-collapsed .sidebar-toggle { right: 14px; }
  .topbar { align-items: flex-start; gap: 16px; flex-direction: column; padding: 20px; }
  .filters,
  .global-filters,
  .kpi-grid,
  .grid.two,
  .grid.three,
  .timeline { grid-template-columns: 1fr; }
  .kpi:nth-child(-n + 3),
  .kpi:nth-child(n + 4) { grid-column: span 12; }
  .quick-range-group { flex-wrap: wrap; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .consumption-table-filters { width: 100%; flex-wrap: wrap; justify-content: flex-start; margin-left: 0; }
  .consumption-table-filters label { flex: 1 1 220px; }
  .consumption-table-filters input,
  .consumption-table-filters select { width: 100%; min-width: 0; }
  .section-label { align-items: flex-start; flex-direction: column; }
  .module-filter { justify-content: flex-start; }
  .filters, main, .page-main, .subpage { padding-left: 16px; padding-right: 16px; }
  .global-alerts { margin-left: 16px; margin-right: 16px; flex-direction: column; }
  .metric-notes,
  .global-filters { margin-left: 16px; margin-right: 16px; }
  .filters.global-filters { grid-template-columns: 1fr; }
  .kpi-panel .panel-head > .global-filters {
    width: 100%;
    margin: 0;
    grid-template-columns: 1fr;
  }
  .metric-notes-grid { grid-template-columns: 1fr; }
  .placeholder-panel { margin: 16px; }
  .chart { height: 260px; }
  .case-library-grid { grid-template-columns: 1fr; }
  .case-page-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .case-upload-button { margin-bottom: 16px; }
  .case-library-toolbar { grid-template-columns: 1fr; }
  .case-classification-fields { grid-template-columns: 1fr; }
  .case-classification-fields label:last-child { grid-column: auto; }
  .kpi-detail-dialog { width: calc(100vw - 24px); }
  .kpi-dialog-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (max-width: 1023px) { .merchant-status-layout, .merchant-status-form { grid-template-columns: 1fr; }.merchant-status-form .primary-action { width: 100%; }.global-alerts, .metric-notes, .global-filters { margin-left: 16px; margin-right: 16px; } }
