:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --line: #d9e2ec;
  --text: #172033;
  --muted: #64748b;
  --blue: #1687ff;
  --cyan: #22d3ee;
  --green: #13a869;
  --orange: #f59e0b;
  --red: #dc2626;
  --dark: #071423;
  --dark-panel: rgba(10, 33, 58, 0.82);
  --dark-line: rgba(82, 180, 255, 0.25);
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-kicker,
.section-kicker {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.main-nav {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.nav-btn,
.seg {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 7px 14px;
  font-weight: 700;
}

.nav-btn.active,
.seg.active {
  background: var(--blue);
  color: #fff;
}

.header-actions,
.upload-group {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.primary-btn,
.ghost-btn,
.upload-btn {
  border-radius: 7px;
  padding: 7px 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.primary-btn {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.data-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  gap: 10px;
  padding: 7px 18px;
  background: #f8fbff;
  border-bottom: 1px solid var(--line);
}

.data-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

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

.data-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  outline: none;
  padding: 0;
}

main {
  padding: 8px 10px 10px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-toolbar {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 7px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

#dashboardView {
  height: calc(100vh - 122px);
  min-height: 0;
  border-radius: 10px;
  padding: 10px;
  overflow: hidden;
  color: #d8f3ff;
  background:
    radial-gradient(circle at 50% 8%, rgba(34, 211, 238, 0.13), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(22, 135, 255, 0.12), transparent 28%),
    linear-gradient(rgba(20, 120, 180, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 120, 180, 0.06) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(23, 96, 166, 0.28), transparent 44%),
    #06111f;
  background-size: auto, auto, 64px 64px, 64px 64px, auto, auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(390px, 1.22fr) minmax(470px, 1.16fr);
  grid-template-rows: minmax(0, 1.48fr) minmax(0, 0.82fr);
  gap: 9px;
  height: calc(100% - 52px);
}

.left-stack {
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  grid-template-rows: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 9px;
  min-height: 0;
}

.left-stack .bi-panel {
  min-height: 0;
}

.bi-panel,
.hero-panel {
  position: relative;
  border: 1px solid rgba(82, 180, 255, 0.32);
  background: linear-gradient(180deg, rgba(10, 43, 77, 0.86), rgba(7, 26, 46, 0.78));
  box-shadow: inset 0 1px 0 rgba(167, 226, 255, 0.08), 0 0 28px rgba(34, 211, 238, 0.08);
}

.bi-panel::before,
.hero-panel::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.68), transparent);
  pointer-events: none;
}

.bi-panel {
  padding: 9px 11px;
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 6px;
  padding-left: 10px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.16);
}

.panel-head::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 3px;
  height: 16px;
  background: linear-gradient(180deg, #5ff4ff, #1687ff);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
}

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

.panel-head span {
  color: #83a9c6;
  font-size: 11px;
}

.compact-head {
  padding-bottom: 5px;
}

.left-top {
  grid-column: 1;
  grid-row: 1;
}

.left-bottom {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-top {
  grid-column: 3;
  grid-row: 1;
}

.right-bottom {
  grid-column: 3;
  grid-row: 2;
}

.right-stack {
  grid-column: 3;
  grid-row: 1 / 3;
  display: grid;
  grid-template-rows: minmax(0, 1.08fr) minmax(0, 0.44fr) minmax(0, 0.48fr);
  gap: 9px;
  min-height: 0;
}

.right-stack .bi-panel {
  min-height: 0;
}

.hero-panel {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 16px 14px;
  min-height: 0;
  overflow: hidden;
}

.hero-title {
  text-align: center;
  margin-bottom: 8px;
}

.hero-title span {
  display: block;
  font-size: 22px;
  font-weight: 800;
}

.hero-title strong {
  display: block;
  margin-top: 4px;
  color: #8fc8e7;
}

.gauge-wrap {
  width: min(340px, 42vh, 58vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
}

.gauge-wrap::before,
.gauge-wrap::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.gauge-wrap::before {
  inset: 4%;
  border: 1px solid rgba(72, 239, 255, 0.16);
  box-shadow: 0 0 42px rgba(34, 211, 238, 0.2);
}

.gauge-wrap::after {
  inset: 18%;
  border: 1px dashed rgba(72, 239, 255, 0.2);
}

.gauge {
  --value: 0%;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #061526 0 55%, transparent 56%),
    conic-gradient(var(--cyan) 0 var(--value), rgba(16, 75, 140, 0.9) var(--value) 100%);
  box-shadow: 0 0 38px rgba(34, 211, 238, 0.22);
  position: relative;
  overflow: hidden;
}

.gauge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 32%, transparent 68%, rgba(72, 239, 255, 0.12));
  mix-blend-mode: screen;
  pointer-events: none;
}

.gauge-inner {
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(5, 20, 36, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.gauge-inner span,
.gauge-inner small {
  color: #8fb4cf;
}

.gauge-inner strong {
  font-size: clamp(40px, 5.8vw, 64px);
  color: #e6fbff;
  line-height: 1.05;
}

.campaign-bound-summary {
  width: min(520px, 100%);
  margin-top: 6px;
  text-align: center;
}

.campaign-bound-summary span {
  display: block;
  color: #b8d5e7;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
}

.campaign-bound-summary strong {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  color: #48efff;
  line-height: 1;
  margin-top: 6px;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.campaign-bound-summary strong b {
  font-size: clamp(38px, 4.7vw, 58px);
}

.campaign-bound-summary strong em,
.campaign-bound-summary small {
  font-style: normal;
  color: #bad8e8;
}

.campaign-bound-summary strong em {
  font-size: 13px;
}

.campaign-bound-summary small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
}

.campaign-bound-summary small b {
  color: #e6fbff;
  font-size: 15px;
}

.binding-summary {
  width: min(620px, 100%);
  margin-top: 13px;
  text-align: center;
}

.binding-summary span {
  display: block;
  color: #a4c6dd;
  font-size: 13px;
  letter-spacing: 0;
}

.binding-summary strong {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  color: #48efff;
  line-height: 1;
  margin-top: 6px;
}

.binding-summary strong b {
  font-size: clamp(40px, 5.2vw, 64px);
}

.binding-summary strong em {
  font-size: 13px;
  font-style: normal;
}

.binding-summary small {
  display: block;
  margin-top: 7px;
  color: #bad8e8;
}

.countdown-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: min(360px, 92%);
  margin-top: 11px;
  color: #bad8e8;
  font-size: 13px;
}

.countdown-title span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.55));
}

.countdown-title span:last-child {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.55), transparent);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  width: min(520px, 100%);
  gap: 8px;
  margin-top: 8px;
}

.countdown div {
  border: 1px solid rgba(34, 211, 238, 0.24);
  background: rgba(10, 43, 77, 0.62);
  padding: 8px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(167, 226, 255, 0.08);
}

.countdown span {
  display: inline-block;
  margin-left: 4px;
  color: #89adca;
  font-size: 11px;
}

.countdown strong {
  display: inline-block;
  color: var(--cyan);
  font-size: 22px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.38);
}

.deadline {
  margin-top: 7px;
  color: #8fb4cf;
  font-size: 11px;
}

.rank-list,
.quality-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

#operatorRank {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 30px minmax(72px, 1fr) 60px;
  gap: 3px 7px;
  align-items: center;
  border-radius: 4px;
  padding: 1px 3px 2px 0;
}

.rank-list.no-sub {
  gap: 2px;
}

.rank-list.no-sub .rank-row {
  grid-template-columns: 30px minmax(72px, 1fr) 60px;
  min-height: 19px;
}

.rank-row .rank-no {
  color: var(--cyan);
  font-weight: 800;
  text-align: center;
}

.rank-row .rank-name {
  min-width: 0;
}

.rank-row strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.15;
}

.rank-row small {
  display: block;
  color: #7da4c2;
  margin-top: 1px;
  font-size: 10.5px;
  line-height: 1.15;
}

.bar {
  grid-column: 2 / 4;
  height: 3px;
  background: rgba(69, 130, 182, 0.25);
  overflow: hidden;
}

.bar span {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.rank-top {
  background: linear-gradient(90deg, rgba(255, 197, 90, 0.12), rgba(34, 211, 238, 0.03));
  border: 1px solid rgba(255, 197, 90, 0.18);
}

.rank-top .rank-no {
  border-radius: 4px;
  color: #071423;
}

.rank-top-1 .rank-no {
  background: linear-gradient(180deg, #fff2a6, #f5a623);
}

.rank-top-2 .rank-no {
  background: linear-gradient(180deg, #eef6ff, #8fb4cf);
}

.rank-top-3 .rank-no {
  background: linear-gradient(180deg, #ffd8a3, #c47a28);
}

.rank-top .bar span {
  background: linear-gradient(90deg, #f5a623, #ffe58a);
}

.rank-list.horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.quality-row {
  display: grid;
  grid-template-columns: 30px minmax(80px, 1fr) 74px 74px;
  gap: 5px;
  align-items: center;
  min-height: 18px;
  font-size: 12px;
}

.quality-row strong {
  color: #fff;
}

.quality-row span {
  color: var(--cyan);
  font-weight: 800;
  text-align: right;
}

.quality-row em {
  color: var(--orange);
  font-style: normal;
  text-align: right;
}

.progress-meta {
  color: #7fa6c4;
  font-size: 10.5px;
}

.progress-tabs {
  display: flex;
  gap: 6px;
  margin: 5px 0;
}

.progress-tabs span {
  min-width: 54px;
  padding: 3px 8px;
  border: 1px solid rgba(82, 180, 255, 0.28);
  background: rgba(10, 43, 77, 0.56);
  color: #8fb4cf;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
}

.progress-tabs .active {
  color: #061526;
  background: var(--cyan);
  border-color: var(--cyan);
}

.progress-table,
.region-mini {
  display: grid;
  gap: 2px;
}

.progress-head,
.progress-row {
  display: grid;
  grid-template-columns: 30px minmax(42px, 0.46fr) minmax(160px, 1.18fr) minmax(150px, 0.92fr);
  gap: 5px;
  align-items: center;
}

.progress-head {
  color: #a9d8f2;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 0 4px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.14);
  background: rgba(6, 21, 38, 0.36);
}

.progress-head span:nth-child(3) {
  color: #8bdcff;
}

.progress-head span:nth-child(4) {
  color: #ffc35a;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 195, 90, 0.28);
}

.progress-head small {
  display: block;
  margin-top: 1px;
  color: #88aeca;
  font-size: 10.5px;
  font-weight: 700;
}

.progress-head .sales8-head small {
  color: #d79a35;
}

.progress-row {
  min-height: 23px;
  color: #d8f3ff;
  font-size: 12.5px;
  border-radius: 4px;
}

.progress-rank {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.progress-name {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.progress-name.hot::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  vertical-align: middle;
}

.progress-target {
  display: grid;
  grid-template-columns: max-content minmax(35px, 1fr) 48px;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding-right: 6px;
}

.progress-sales8 {
  display: grid;
  grid-template-columns: max-content minmax(35px, 1fr) 44px;
  gap: 5px;
  align-items: center;
  min-width: 0;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 195, 90, 0.28);
}

.progress-target b,
.progress-sales8 b {
  color: #b9d7e8;
  font-size: 13px;
  font-weight: 800;
  min-width: max-content;
  white-space: nowrap;
}

.progress-target i,
.progress-sales8 i {
  display: block;
  height: 4px;
  background: rgba(69, 130, 182, 0.32);
  overflow: hidden;
}

.progress-target em {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #16a7ff, #42f2ff);
}

.progress-sales8 em {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ffd166);
}

.progress-target strong,
.progress-sales8 strong {
  color: var(--cyan);
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

.progress-sales8 strong {
  color: var(--orange);
}

.progress-top {
  background: linear-gradient(90deg, rgba(255, 197, 90, 0.12), rgba(34, 211, 238, 0.02));
}

.progress-top .progress-rank {
  border-radius: 4px;
  color: #071423;
}

.progress-top-1 .progress-rank {
  background: linear-gradient(180deg, #fff2a6, #f5a623);
}

.progress-top-2 .progress-rank {
  background: linear-gradient(180deg, #eef6ff, #8fb4cf);
}

.progress-top-3 .progress-rank {
  background: linear-gradient(180deg, #ffd8a3, #c47a28);
}

.region-mini {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(34, 211, 238, 0.16);
}

.region-mini-title {
  color: #d8f3ff;
  font-size: 12px;
  font-weight: 800;
}

.region-mini .progress-row {
  grid-template-columns: 30px minmax(42px, 0.46fr) minmax(160px, 1.18fr) minmax(150px, 0.92fr);
}

.trend-chart,
.region-line-chart {
  width: 100%;
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(130, 190, 230, 0.15);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.32));
}

.chart-dot {
  fill: #e6fbff;
  stroke: var(--cyan);
  stroke-width: 2;
}

.chart-value {
  fill: #e6fbff;
  font-size: 12px;
  font-weight: 800;
}

.chart-label {
  fill: #83a9c6;
  font-size: 10px;
}

.trend-ranking,
.region-ranking {
  display: grid;
  gap: 5px;
  margin-top: 4px;
}

.trend-rank-row,
.region-rank-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 54px 74px;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #a8c9df;
}

.trend-rank-row span,
.region-rank-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-weight: 700;
}

.trend-rank-row strong,
.region-rank-row strong {
  color: var(--cyan);
  text-align: right;
}

.trend-rank-row small,
.region-rank-row small {
  color: #83a9c6;
  text-align: right;
}

.region-legend {
  display: flex;
  gap: 12px;
  margin: 8px 0 2px;
  color: #a8c9df;
  font-size: 11px;
}

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

.region-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.region-cities {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  color: #83a9c6;
  font-size: 10.5px;
  line-height: 1.35;
}

.region-cities b {
  color: #d8f3ff;
  margin-right: 6px;
}

.overall-progress {
  height: calc(100% - 28px);
  margin-top: 0;
  min-width: 0;
  display: grid;
  align-items: stretch;
}

.overall-note {
  color: #83a9c6;
  font-size: 10.5px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overall-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: end;
  gap: 12px;
  margin-bottom: 8px;
  padding-right: 4px;
  min-width: 0;
}

.overall-hero span {
  display: block;
  color: #a8c9df;
  font-size: 12px;
}

.overall-hero small {
  display: block;
  margin-top: 5px;
  color: #83a9c6;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overall-hero strong {
  color: #48efff;
  font-size: clamp(32px, 2.45vw, 46px);
  line-height: 0.95;
  justify-self: end;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(72, 239, 255, 0.32);
}

.overall-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.overall-main span {
  display: block;
  color: #8fb4cf;
  margin-bottom: 8px;
}

.overall-main strong {
  color: var(--cyan);
  font-size: 34px;
  line-height: 1;
}

.overall-main small {
  color: #8fb4cf;
}

.overall-bar {
  height: 9px;
  background: rgba(69, 130, 182, 0.25);
  margin: 8px 0 9px;
  overflow: hidden;
}

.overall-bar span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: linear-gradient(90deg, #1687ff, #22d3ee);
}

.overall-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  height: 100%;
  border-top: 1px solid rgba(34, 211, 238, 0.18);
  border-left: 1px solid rgba(34, 211, 238, 0.18);
}

.overall-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  border-right: 1px solid rgba(34, 211, 238, 0.18);
  border-bottom: 1px solid rgba(34, 211, 238, 0.18);
  background: rgba(7, 24, 42, 0.5);
}

.overall-cell span {
  display: block;
  color: #8fb4cf;
  font-size: 12px;
}

.overall-cell strong {
  display: block;
  margin-top: 5px;
  color: #e6fbff;
  font-size: 22px;
}

.overall-cell em {
  color: #8fb4cf;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

.workbench {
  display: none;
}

.workbench.active {
  display: block;
}

.workbench-layout {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card,
.work-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 14px 16px;
}

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

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
}

.metric-select {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.work-panel {
  padding: 16px;
}

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

.work-head h2 {
  margin: 0;
  font-size: 17px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.filters[data-filter-form="monthly"] {
  grid-template-columns: 260px 260px 140px 136px 104px 104px 104px 100px 100px 100px 82px 310px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filters[data-filter-form="weekly"] {
  grid-template-columns: 260px 260px 150px 150px 118px 118px 118px 112px 112px 310px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-actions {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr) minmax(0, 0.8fr);
  gap: 8px;
  align-items: end;
}

.filters[data-filter-form="monthly"] .filter-actions {
  grid-column: auto;
}

.filters[data-filter-form="weekly"] .filter-actions {
  grid-column: auto;
}

.filter-actions .primary-btn,
.filter-actions .ghost-btn {
  width: 100%;
  min-height: 37px;
  min-width: 0;
  padding-inline: 6px;
  white-space: nowrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.range-field {
  min-width: 240px;
}

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

.field input,
.field select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  min-width: 0;
  background: #fff;
  color: var(--text);
}

.filters[data-filter-form="monthly"] .field input,
.filters[data-filter-form="monthly"] .field select,
.filters[data-filter-form="weekly"] .field input,
.filters[data-filter-form="weekly"] .field select {
  padding: 7px 8px;
}

.date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

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

.field input[list] {
  padding-right: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
}

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

.summary-table th,
.summary-table td,
.device-table th,
.device-table td {
  text-align: center;
  vertical-align: middle;
}

.device-table td:last-child {
  text-align: left;
}

.metric-head {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
  white-space: normal;
}

.metric-head small {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.metric-box {
  display: inline-flex;
  min-width: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.18;
  text-align: center;
}

.metric-box strong {
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.metric-box small {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.metric-box small.ok {
  color: #15803d;
}

.metric-box small.bad {
  color: #dc2626;
}

.blank-shop-row td {
  color: #64748b;
}

.sort-th {
  border: 0;
  padding: 0;
  background: transparent;
  color: #172033;
  font-weight: 800;
}

.summary-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.summary-pager > div {
  display: flex;
  gap: 6px;
}

.ghost-btn.mini {
  padding: 4px 8px;
  font-size: 12px;
}

.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status {
  display: inline-flex;
  align-items: center;
  min-width: 62px;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-weight: 800;
  font-size: 12px;
}

.status.pass {
  background: #dcfce7;
  color: #15803d;
}

.status.doing {
  background: #fef3c7;
  color: #b45309;
}

.status.fail,
.status.high {
  background: #fee2e2;
  color: #b91c1c;
}

.status.follow {
  background: #dbeafe;
  color: #1d4ed8;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 12px 14px;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s;
  pointer-events: none;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-height: 820px) {
  .app-header {
    padding: 6px 14px;
  }

  .brand-kicker,
  .section-kicker {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .nav-btn,
  .seg,
  .primary-btn,
  .ghost-btn,
  .upload-btn {
    padding: 6px 10px;
  }

  .data-bar {
    padding: 6px 14px;
  }

  .data-item span {
    font-size: 11px;
  }

  main {
    padding: 7px 8px 8px;
  }

  .dashboard-toolbar {
    gap: 16px;
    margin-bottom: 6px;
  }

  #dashboardView {
    height: calc(100vh - 112px);
    padding: 8px;
  }

  .dashboard-grid {
    gap: 8px;
    height: calc(100% - 46px);
  }

  .right-stack {
    grid-template-rows: minmax(0, 1.08fr) minmax(0, 0.44fr) minmax(0, 0.48fr);
    gap: 8px;
  }

  .bi-panel {
    padding: 8px 10px;
  }

  .hero-panel {
    padding: 14px 12px 10px;
  }

  .hero-title {
    margin-bottom: 6px;
  }

  .hero-title span {
    font-size: 20px;
  }

  .hero-title strong {
    font-size: 12px;
  }

  .gauge-wrap {
    width: min(265px, 36vh, 52vw);
  }

  .gauge-inner strong {
    font-size: clamp(34px, 5vw, 50px);
  }

  .campaign-bound-summary {
    margin-top: 5px;
  }

  .campaign-bound-summary span {
    font-size: 12px;
    letter-spacing: 3px;
  }

  .campaign-bound-summary strong b {
    font-size: clamp(30px, 4.3vw, 46px);
  }

  .campaign-bound-summary small {
    margin-top: 5px;
    font-size: 11px;
  }

  .binding-summary {
    margin-top: 8px;
  }

  .binding-summary strong b {
    font-size: clamp(34px, 4.8vw, 52px);
  }

  .countdown-title {
    margin-top: 9px;
  }

  .countdown {
    gap: 7px;
    margin-top: 8px;
  }

  .countdown div {
    padding: 6px;
  }

  .countdown strong {
    font-size: 20px;
  }

  .trend-rank-row:nth-child(n+5),
  .region-cities {
    display: none;
  }

  .progress-row {
    min-height: 21px;
    font-size: 12.5px;
  }

  .progress-head {
    font-size: 12.5px;
    padding: 2px 0 3px;
  }

  .progress-head,
  .progress-row,
  .region-mini .progress-row {
    grid-template-columns: 26px minmax(38px, 0.42fr) minmax(150px, 1.12fr) minmax(132px, 0.9fr);
    gap: 4px;
  }

  .progress-target {
    grid-template-columns: max-content minmax(30px, 1fr) 42px;
    gap: 4px;
    padding-right: 5px;
  }

  .progress-sales8 {
    grid-template-columns: max-content minmax(30px, 1fr) 38px;
    gap: 4px;
    padding-left: 4px;
  }

  .progress-target b {
    font-size: 12.5px;
  }

  .progress-sales8 b {
    font-size: 12px;
  }

  .region-mini {
    margin-top: 4px;
    padding-top: 4px;
  }

  .overall-hero strong {
    font-size: clamp(30px, 2.25vw, 38px);
  }

  .overall-cell {
    padding: 7px 8px;
  }

  .overall-cell strong {
    font-size: 18px;
  }

  .overall-progress {
    height: calc(100% - 26px);
  }
}

@media (max-width: 1180px) {
  .app-header,
  .data-bar,
  .dashboard-grid,
  .left-stack,
  .right-stack,
  .two-col {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .upload-group {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero-panel,
  .left-top,
  .left-bottom,
  .left-stack,
  .right-top,
  .right-bottom,
  .right-stack {
    grid-column: auto;
    grid-row: auto;
  }

  .hero-panel {
    min-height: auto;
  }
}
