:root {
  color-scheme: light;
  --color-primary: #2563eb;
  --color-primary-strong: #1d4ed8;
  --color-primary-soft: #eaf1ff;
  --color-accent: #ea580c;
  --color-accent-soft: #fff1e8;
  --color-success: #087a55;
  --color-success-soft: #e7f8f1;
  --color-danger: #c2413a;
  --color-danger-soft: #fff0ee;
  --color-warning: #9a5b00;
  --color-warning-soft: #fff7df;
  --color-background: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fafc;
  --color-foreground: #172033;
  --color-muted: #5f6c80;
  --color-border: #dfe6f0;
  --color-grid: #e8edf4;
  --shadow-card: 0 8px 28px rgba(23, 32, 51, 0.07);
  --shadow-float: 0 16px 40px rgba(23, 32, 51, 0.15);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --sidebar-width: 248px;
  --transition: 180ms ease-out;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--color-background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--color-foreground);
  background:
    radial-gradient(circle at 88% 0%, rgba(37, 99, 235, 0.06), transparent 28rem),
    var(--color-background);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
summary {
  font: inherit;
}

button,
summary,
select,
input[type="date"] {
  touch-action: manipulation;
}

button {
  color: inherit;
}

button:not(:disabled),
summary,
select,
input[type="date"],
label:has(input) {
  cursor: pointer;
}

button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--color-primary-strong);
  font-weight: 700;
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100dvh;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px;
  color: #dce7fa;
  background: #111a2e;
  box-shadow: 8px 0 28px rgba(17, 26, 46, 0.12);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

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

.brand-block span {
  color: #8fa4c6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-block strong {
  margin-top: 2px;
  color: #fff;
  font-size: 18px;
}

.view-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: grid;
  min-height: 64px;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #9fb0cb;
  background: transparent;
  text-align: left;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

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

.nav-button.active {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.22);
  background: rgba(37, 99, 235, 0.22);
}

.nav-button svg,
.sidebar-action svg,
.reset-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button span,
.nav-button b,
.nav-button small {
  display: block;
}

.nav-button b {
  font-size: 14px;
}

.nav-button small {
  margin-top: 2px;
  color: #8295b3;
  font-size: 11px;
}

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: #43d39e;
  box-shadow: 0 0 0 4px rgba(67, 211, 158, 0.12);
}

.sidebar-note strong,
.sidebar-note small {
  display: block;
}

.sidebar-note strong {
  color: #e9f1ff;
  font-size: 12px;
}

.sidebar-note small {
  margin-top: 3px;
  color: #8295b3;
  font-size: 10px;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-action {
  display: flex;
  min-height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  color: #b9c7dd;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.sidebar-action:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(37, 99, 235, 0.18);
}

.sidebar-action svg {
  width: 18px;
  height: 18px;
}

.main-content {
  width: calc(100% - var(--sidebar-width));
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
  padding: 26px clamp(20px, 2.5vw, 42px) 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 22px;
  max-width: 1500px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(26px, 2.4vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.page-description {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--color-muted);
}

.topbar-meta {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.topbar-meta div {
  min-width: 150px;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.topbar-meta span,
.topbar-meta strong {
  display: block;
}

.topbar-meta span {
  color: var(--color-muted);
  font-size: 11px;
}

.topbar-meta strong {
  margin-top: 3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.filter-panel {
  position: relative;
  z-index: 20;
  max-width: 1500px;
  margin: 0 auto 20px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
}

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

.filter-heading h2,
.panel-header h2,
.section-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.3;
}

.date-presets {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-subtle);
}

.date-presets button {
  min-height: 36px;
  padding: 6px 13px;
  border: 0;
  border-radius: 7px;
  color: var(--color-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.date-presets button:hover,
.date-presets button.active {
  color: var(--color-primary-strong);
  background: #fff;
  box-shadow: 0 3px 10px rgba(23, 32, 51, 0.08);
}

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

.field-control,
.multi-select summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.field-control > span,
.multi-select summary > span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
}

.field-control input,
.field-control select,
.multi-select summary {
  min-width: 0;
  height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-foreground);
  background: #fff;
  font-size: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-control input:hover,
.field-control select:hover,
.multi-select summary:hover,
.multi-select[open] summary {
  border-color: #9bb7ef;
}

.multi-select {
  position: relative;
  min-width: 0;
}

.multi-select summary {
  position: relative;
  display: flex;
  list-style: none;
  justify-content: center;
  padding-right: 28px;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  position: absolute;
  right: 10px;
  bottom: 11px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--color-muted);
  border-bottom: 1.5px solid var(--color-muted);
  content: "";
  transform: rotate(45deg);
  transition: transform var(--transition);
}

.multi-select[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.multi-select summary strong {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.select-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 0;
  width: max(240px, 100%);
  max-height: 330px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-float);
}

.select-popover.wide {
  width: 330px;
}

.select-list {
  display: grid;
  gap: 2px;
}

.option-row {
  display: grid;
  min-height: 42px;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  transition: background var(--transition);
}

.option-row:hover {
  background: var(--color-primary-soft);
}

.option-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.option-row span,
.option-row small {
  display: block;
}

.option-row span {
  font-size: 12px;
  font-weight: 650;
}

.option-row small {
  margin-top: 1px;
  color: var(--color-muted);
  font-size: 10px;
}

.reset-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.reset-button:hover,
.secondary-button:hover {
  color: var(--color-primary-strong);
  border-color: #9bb7ef;
  background: var(--color-primary-soft);
}

.reset-button svg {
  width: 16px;
  height: 16px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  margin-top: 10px;
}

.filter-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid #cbdaf8;
  border-radius: 999px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 11px;
  font-weight: 650;
}

.filter-chip button {
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  place-items: center;
}

.filter-chip button:hover {
  background: rgba(37, 99, 235, 0.12);
}

#dashboardCapture,
.dashboard-view,
.page-footer {
  max-width: 1500px;
  margin-inline: auto;
}

.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
  animation: view-enter 220ms ease-out;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  position: relative;
  min-width: 0;
  min-height: 126px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.kpi-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 56px;
  border-radius: 0 0 0 56px;
  background: var(--color-primary-soft);
  content: "";
}

.kpi-card.accent::after {
  background: var(--color-accent-soft);
}

.kpi-card.success::after {
  background: var(--color-success-soft);
}

.kpi-card > span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 650;
}

.kpi-card > strong {
  display: block;
  overflow: hidden;
  margin-top: 9px;
  font-size: clamp(21px, 1.9vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

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

.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 750;
}

.metric-delta.positive {
  color: var(--color-success);
  background: var(--color-success-soft);
}

.metric-delta.negative {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.mini-progress,
.progress-track {
  height: 5px;
  overflow: hidden;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--color-grid);
}

.mini-progress i,
.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
}

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

.operation-metric-group {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 16px 16px 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.operation-metric-group::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--group-color, var(--color-primary));
  content: "";
}

.operation-metric-group:nth-child(1) {
  --group-color: #2563eb;
  --group-soft: rgba(37, 99, 235, 0.09);
  --group-border: rgba(37, 99, 235, 0.2);
}

.operation-metric-group:nth-child(2) {
  --group-color: #0f8b74;
  --group-soft: rgba(15, 139, 116, 0.085);
  --group-border: rgba(15, 139, 116, 0.2);
}

.operation-metric-group:nth-child(3) {
  --group-color: #d97706;
  --group-soft: rgba(217, 119, 6, 0.09);
  --group-border: rgba(217, 119, 6, 0.22);
}

.operation-metric-group > div:first-child {
  min-height: 58px;
  margin-bottom: 12px;
  padding-left: 2px;
}

.operation-metric-group .section-kicker {
  color: var(--group-color);
}

.operation-metric-group p {
  margin: 5px 0 0;
  color: var(--color-muted);
  font-size: 11px;
}

.operation-metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: stretch;
}

.operation-metric {
  min-width: 0;
  min-height: 78px;
  padding: 10px 11px;
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: 10px;
  background: var(--color-surface-subtle);
}

.operation-metric:first-child {
  grid-column: 1 / -1;
  min-height: 96px;
  padding: 13px 14px;
  border-color: var(--group-border);
  background: linear-gradient(135deg, var(--group-soft), #fff);
}

.operation-metric span,
.operation-metric strong,
.operation-metric small {
  display: block;
}

.operation-metric span {
  color: var(--color-muted);
  font-size: 9px;
  font-weight: 800;
}

.operation-metric strong {
  overflow: hidden;
  margin-top: 4px;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.operation-metric:first-child strong {
  margin-top: 6px;
  color: var(--group-color);
  font-size: 25px;
  line-height: 1.05;
}

.operation-metric small {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 9px;
  line-height: 1.35;
}

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

.trend-layout {
  grid-template-columns: minmax(0, 2.15fr) minmax(290px, 0.85fr);
}

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

.operation-top-grid {
  grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.2fr);
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header small,
.section-heading p {
  color: var(--color-muted);
  font-size: 11px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  color: var(--color-muted);
  font-size: 11px;
}

.chart-legend span {
  position: relative;
  padding-left: 18px;
}

.chart-legend span::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary);
  content: "";
  transform: translateY(-50%);
}

.chart-legend .legend-previous::before {
  background: #9aa7b8;
}

.insight-line {
  min-height: 30px;
  margin: -4px 0 8px;
  color: var(--color-muted);
  font-size: 12px;
}

.insight-line strong {
  color: var(--color-foreground);
}

.chart-wrap {
  min-height: 255px;
}

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

.line-chart text {
  fill: var(--color-muted);
  font-family: inherit;
  font-size: 10px;
}

.line-chart .grid-line {
  stroke: var(--color-grid);
  stroke-width: 1;
}

.line-chart .current-area {
  fill: url(#salesAreaGradient);
}

.line-chart .current-line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart .previous-line {
  fill: none;
  stroke: #9aa7b8;
  stroke-width: 2;
  stroke-dasharray: 5 6;
  stroke-linecap: round;
}

.chart-point {
  fill: #fff;
  stroke: var(--color-primary);
  stroke-width: 2;
  cursor: pointer;
  transition: r var(--transition), fill var(--transition), stroke-width var(--transition);
}

.chart-point:hover,
.chart-point:focus,
.chart-point.active {
  fill: var(--color-primary);
  r: 6;
  stroke-width: 3;
}

.trend-tooltip-line {
  stroke: rgba(183,157,117,.62);
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
}

.trend-tooltip-card {
  animation: tooltip-pop 180ms ease-out;
  pointer-events: none;
}

#trendTooltip.hidden {
  display: none;
}

.trend-tooltip-card rect {
  fill: #15181c;
  stroke: #b79d75;
  stroke-width: 1;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.36));
}

.line-chart .trend-tooltip-card text {
  font-size: 11px;
}

.line-chart .trend-tooltip-card .tooltip-date {
  fill: #e9eaec;
  font-weight: 800;
}

.line-chart .trend-tooltip-card .tooltip-label {
  fill: #a4a8ae;
}

.line-chart .trend-tooltip-card .tooltip-value {
  fill: #e9eaec;
  font-weight: 850;
}

.line-chart .trend-tooltip-card .tooltip-value.positive {
  fill: #d9b476;
}

.line-chart .trend-tooltip-card .tooltip-value.negative {
  fill: #d76e6e;
}

@keyframes tooltip-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.attention-list {
  display: grid;
  gap: 8px;
}

.count-badge {
  display: grid;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  font-size: 12px;
  font-weight: 800;
  place-items: center;
}

.attention-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-subtle);
}

.attention-item > i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--color-warning);
}

.attention-item.danger > i {
  background: var(--color-danger);
}

.attention-item strong,
.attention-item small {
  display: block;
}

.attention-item strong {
  font-size: 11px;
}

.attention-item small {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 10px;
}

.attention-item > span {
  color: var(--color-danger);
  font-size: 11px;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 12px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-index {
  color: #c8d2e1;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.section-heading p {
  max-width: 520px;
  margin: 0;
  text-align: right;
}

.store-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.store-card {
  min-width: 0;
  min-height: 165px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.store-card:hover {
  border-color: #9bb7ef;
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.11);
  transform: translateY(-2px);
}

.store-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12), var(--shadow-card);
}

.store-card-main {
  padding: 15px 15px 10px;
}

.store-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.store-card-title strong {
  overflow: hidden;
  max-width: 82%;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-count {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 9px;
  font-weight: 750;
}

.store-sales-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
}

.store-sales-row strong {
  font-size: 22px;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.store-sales-row span {
  color: var(--color-muted);
  font-size: 10px;
}

.store-card-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--color-border);
  background: var(--color-border);
}

.store-card-footer div {
  padding: 9px 10px;
  background: var(--color-surface-subtle);
}

.store-card-footer span,
.store-card-footer b {
  display: block;
}

.store-card-footer span {
  color: var(--color-muted);
  font-size: 9px;
}

.store-card-footer b {
  margin-top: 2px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.bar-chart-list,
.rank-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(120px, 2fr) auto;
  align-items: center;
  gap: 10px;
}

.bar-label strong,
.bar-label small {
  display: block;
}

.bar-label strong {
  font-size: 11px;
}

.bar-label small {
  color: var(--color-muted);
  font-size: 9px;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-grid);
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--color-primary));
}

.bar-value {
  min-width: 74px;
  text-align: right;
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.rank-item {
  display: grid;
  min-height: 43px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  transition: background var(--transition);
}

.rank-item:hover {
  background: var(--color-primary-soft);
}

.rank-number {
  display: grid;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: var(--color-muted);
  background: var(--color-surface-subtle);
  font-size: 10px;
  font-weight: 800;
  place-items: center;
}

.rank-item:nth-child(-n + 3) .rank-number {
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
}

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

.rank-name strong,
.rank-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-name strong {
  font-size: 11px;
}

.rank-name small {
  margin-top: 1px;
  color: var(--color-muted);
  font-size: 9px;
}

.rank-value {
  text-align: right;
}

.rank-value strong,
.rank-value small {
  display: block;
}

.rank-value strong {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.rank-value small {
  margin-top: 1px;
  color: var(--color-muted);
  font-size: 9px;
}

.model-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.model-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.model-summary {
  display: block;
  width: 100%;
  min-height: 142px;
  padding: 14px;
  border: 0;
  background: #fff;
  text-align: left;
}

.model-summary:hover {
  background: var(--color-surface-subtle);
}

.model-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.model-heading strong,
.model-heading small {
  display: block;
}

.model-heading strong {
  font-size: 13px;
}

.model-heading small {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 9px;
}

.expand-indicator {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  place-items: center;
}

.model-card.expanded .expand-indicator {
  transform: rotate(180deg);
}

.model-sales {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.model-sales strong {
  font-size: 21px;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.model-sales span {
  color: var(--color-muted);
  font-size: 9px;
}

.model-rates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.model-rates div {
  padding: 6px;
  border-radius: 8px;
  background: var(--color-surface-subtle);
}

.model-rates span,
.model-rates b {
  display: block;
}

.model-rates span {
  color: var(--color-muted);
  font-size: 8px;
}

.model-rates b {
  margin-top: 2px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.model-details {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--color-border);
  background: var(--color-border);
}

.model-card.expanded .model-details {
  display: grid;
}

.model-details div {
  padding: 10px;
  background: var(--color-surface-subtle);
}

.model-details span,
.model-details strong {
  display: block;
}

.model-details span {
  color: var(--color-muted);
  font-size: 8px;
}

.model-details strong {
  margin-top: 3px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.channel-panel {
  margin-bottom: 20px;
}

.channel-board {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.6fr);
  gap: 18px;
  align-items: start;
}

.channel-visual-main,
.channel-rate-panel,
.channel-insight-panel {
  min-width: 0;
}

.channel-total-hero {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(110px, 0.7fr));
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-primary-soft), #fff);
}

.channel-total-hero div {
  min-width: 0;
}

.channel-total-hero span,
.channel-total-hero strong {
  display: block;
}

.channel-total-hero span {
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 700;
}

.channel-total-hero strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--color-foreground);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.channel-total-hero div:first-child strong {
  color: var(--color-primary-strong);
  font-size: 24px;
}

.channel-sales-chart {
  display: grid;
  gap: 10px;
}

.channel-sales-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.75fr) minmax(140px, 1.8fr) minmax(82px, auto);
  align-items: center;
  gap: 10px;
}

.channel-name strong,
.channel-name small {
  display: block;
}

.channel-name strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-name small {
  color: var(--color-muted);
  font-size: 9px;
}

.channel-bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-grid);
}

.channel-bar-track i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar-color, var(--color-primary)), rgba(37, 99, 235, 0.55));
}

.channel-sales-row > span {
  text-align: right;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.channel-rate-panel {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-subtle);
}

.channel-insight-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.96)),
    var(--color-surface-subtle);
}

.rate-panel-heading strong,
.rate-panel-heading small {
  display: block;
}

.rate-panel-heading strong {
  font-size: 13px;
}

.rate-panel-heading small {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 10px;
}

.channel-rate-row {
  display: grid;
  gap: 6px;
}

.channel-rate-row > strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rate-bars {
  display: grid;
  gap: 5px;
}

.rate-bars span {
  display: grid;
  grid-template-columns: 34px minmax(80px, 1fr) 42px;
  align-items: center;
  gap: 6px;
  color: var(--color-muted);
  font-size: 9px;
}

.rate-bars i {
  display: block;
  height: 7px;
  min-width: 2px;
  border-radius: 999px;
  background: var(--color-success);
}

.rate-bars .refund i {
  background: var(--color-accent);
}

.rate-bars b {
  color: var(--color-foreground);
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.channel-insight-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px 13px 12px 16px;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.channel-insight-card::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: var(--color-primary);
  content: "";
}

.channel-insight-card.highlight {
  border-color: rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.11), rgba(255, 255, 255, 0.94));
}

.channel-insight-card.warning::before {
  background: var(--color-accent);
}

.channel-insight-card span,
.channel-insight-card strong,
.channel-insight-card small {
  display: block;
}

.channel-insight-card span {
  color: var(--color-muted);
  font-size: 9px;
  font-weight: 800;
}

.channel-insight-card strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-insight-card small {
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 700;
}

.channel-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.channel-summary-card {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface-subtle);
}

.channel-summary-card span,
.channel-summary-card strong,
.channel-summary-card small {
  display: block;
}

.channel-summary-card span {
  color: var(--color-muted);
  font-size: 9px;
}

.channel-summary-card strong {
  margin-top: 4px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.channel-summary-card small {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 9px;
}

.conversion-path {
  display: grid;
  gap: 9px;
}

.conversion-step {
  position: relative;
  display: grid;
  min-height: 54px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface-subtle);
}

.conversion-step::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--step-width, 100%);
  background: rgba(37, 99, 235, 0.055);
  content: "";
}

.conversion-step > * {
  position: relative;
  z-index: 1;
}

.conversion-number {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 11px;
  font-weight: 800;
  place-items: center;
}

.conversion-label strong,
.conversion-label small {
  display: block;
}

.conversion-label strong {
  font-size: 11px;
}

.conversion-label small {
  color: var(--color-muted);
  font-size: 9px;
}

.conversion-value {
  text-align: right;
}

.conversion-value strong,
.conversion-value small {
  display: block;
}

.conversion-value strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.conversion-value small {
  color: var(--color-muted);
  font-size: 9px;
}

.quadrant-chart {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border: 1px solid var(--color-grid);
  border-radius: 12px;
  background:
    linear-gradient(to right, transparent 49.8%, var(--color-grid) 50%, transparent 50.2%),
    linear-gradient(to bottom, transparent 49.8%, var(--color-grid) 50%, transparent 50.2%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.025), rgba(8, 122, 85, 0.035));
}

.quadrant-label {
  position: absolute;
  color: var(--color-muted);
  font-size: 9px;
  font-weight: 700;
}

.quadrant-label.top-left { top: 9px; left: 10px; }
.quadrant-label.top-right { top: 9px; right: 10px; color: var(--color-success); }
.quadrant-label.bottom-left { bottom: 9px; left: 10px; }
.quadrant-label.bottom-right { right: 10px; bottom: 9px; }

.bubble {
  position: absolute;
  display: grid;
  width: var(--size);
  height: var(--size);
  min-width: 30px;
  min-height: 30px;
  padding: 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--bubble-color, var(--color-primary));
  box-shadow: 0 5px 16px rgba(23, 32, 51, 0.18);
  font-size: 8px;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  transform: translate(-50%, 50%);
  place-items: center;
}

.bubble:focus-visible {
  z-index: 5;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-scroll {
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--color-muted);
  background: var(--color-surface-subtle);
  font-size: 10px;
  font-weight: 750;
}

.data-table th button {
  min-height: 32px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: inherit;
}

.data-table th button:hover,
.data-table th button.active {
  color: var(--color-primary-strong);
}

.operation-table {
  min-width: 1440px;
  --traffic-bg: rgba(37, 99, 235, 0.075);
  --traffic-head: rgba(37, 99, 235, 0.16);
  --content-bg: rgba(15, 139, 116, 0.07);
  --content-head: rgba(15, 139, 116, 0.15);
  --conversion-bg: rgba(217, 119, 6, 0.075);
  --conversion-head: rgba(217, 119, 6, 0.16);
}

.operation-table thead tr:first-child th {
  border-bottom: 1px solid #cbdaf8;
  text-align: center;
}

.operation-table thead tr:first-child th:first-child {
  color: var(--color-primary-strong);
  background: var(--traffic-head);
}

.operation-table thead tr:first-child th:nth-child(2),
.operation-table thead tr:nth-child(2) th:nth-child(-n + 3),
.operation-table tbody td:nth-child(n + 2):nth-child(-n + 4) {
  background: var(--traffic-bg);
}

.operation-table thead tr:first-child th:nth-child(2) {
  color: #1d4ed8;
  background: var(--traffic-head);
}

.operation-table thead tr:first-child th:nth-child(3),
.operation-table thead tr:nth-child(2) th:nth-child(n + 4):nth-child(-n + 9),
.operation-table tbody td:nth-child(n + 5):nth-child(-n + 10) {
  background: var(--content-bg);
}

.operation-table thead tr:first-child th:nth-child(3) {
  color: #0f766e;
  background: var(--content-head);
}

.operation-table thead tr:first-child th:nth-child(4),
.operation-table thead tr:nth-child(2) th:nth-child(n + 10),
.operation-table tbody td:nth-child(n + 11) {
  background: var(--conversion-bg);
}

.operation-table thead tr:first-child th:nth-child(4) {
  color: #b45309;
  background: var(--conversion-head);
}

.operation-table thead tr:nth-child(2) th:nth-child(-n + 3) {
  color: #315fbd;
}

.operation-table thead tr:nth-child(2) th:nth-child(n + 4):nth-child(-n + 9) {
  color: #147365;
}

.operation-table thead tr:nth-child(2) th:nth-child(n + 10) {
  color: #a75b09;
}

.operation-table thead tr:nth-child(2) th {
  top: 39px;
}

.operation-table tbody tr:hover td {
  filter: brightness(0.985);
}

.operation-table tbody tr.summary-row td {
  border-top: 1px solid #b8c9ea;
  border-bottom: 1px solid #b8c9ea;
  font-weight: 850;
}

.operation-table tbody tr.summary-row td:first-child,
.operation-table tbody tr.summary-row td:nth-child(2) {
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
}

.data-table tbody tr:hover {
  background: var(--color-primary-soft);
}

.table-account-button {
  display: block;
  max-width: 260px;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--color-foreground);
  background: transparent;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.table-account-button:hover {
  color: var(--color-primary-strong);
  text-decoration: underline;
}

.table-account-shop {
  display: block;
  max-width: 260px;
  overflow: hidden;
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-progress {
  display: inline-flex;
  min-width: 108px;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.table-progress i {
  display: block;
  width: 56px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-grid);
}

.table-progress i::after {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--progress-color, var(--color-primary));
  content: "";
}

.line-efficiency,
.year-comparison {
  display: grid;
  gap: 9px;
}

.efficiency-row,
.year-row {
  display: grid;
  align-items: center;
  gap: 9px;
}

.efficiency-row {
  grid-template-columns: minmax(90px, 0.7fr) minmax(130px, 2fr) auto;
}

.year-row {
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1.5fr) auto;
}

.comparison-bars {
  display: grid;
  gap: 3px;
}

.comparison-bar {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 5px;
}

.comparison-bar span {
  color: var(--color-muted);
  font-size: 8px;
}

.comparison-bar i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--bar-color);
}

.empty-state {
  display: grid;
  min-height: 150px;
  align-content: center;
  justify-items: center;
  padding: 24px;
  color: var(--color-muted);
  text-align: center;
}

.empty-state strong {
  color: var(--color-foreground);
}

.empty-state small {
  max-width: 360px;
  margin-top: 4px;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 24px;
  padding: 14px 2px 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 1000;
  right: 26px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid #b9ccee;
  border-radius: 10px;
  color: var(--color-primary-strong);
  background: #fff;
  box-shadow: var(--shadow-float);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity var(--transition), transform var(--transition);
}

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

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1280px) {
  .filter-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

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

  .operation-metric-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-board,
  .model-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 88px;
  }

  .sidebar {
    align-items: center;
    padding-inline: 11px;
  }

  .brand-block {
    padding-inline: 0;
  }

  .brand-block > div:last-child,
  .nav-button span,
  .sidebar-note div,
  .sidebar-action {
    font-size: 0;
  }

  .nav-button {
    display: grid;
    width: 58px;
    min-height: 54px;
    grid-template-columns: 1fr;
    place-items: center;
  }

  .nav-button svg {
    width: 23px;
    height: 23px;
  }

  .sidebar-note {
    display: grid;
    width: 48px;
    padding: 14px;
    place-items: center;
  }

  .status-dot {
    margin: 0;
  }

  .sidebar-actions {
    grid-template-columns: 1fr;
  }

  .sidebar-action {
    width: 48px;
    height: 44px;
  }

  .trend-layout,
  .operation-top-grid,
  .channel-board {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  body {
    font-size: 16px;
  }

  .app-shell {
    padding-bottom: 78px;
  }

  .sidebar {
    inset: auto 0 0;
    width: 100%;
    min-height: 70px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .brand-block,
  .sidebar-note,
  .sidebar-actions {
    display: none;
  }

  .view-nav {
    width: min(420px, 100%);
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-button {
    width: 100%;
    min-height: 50px;
    grid-template-columns: 22px auto;
    padding: 7px 12px;
  }

  .nav-button span {
    display: block;
    font-size: initial;
  }

  .nav-button b {
    font-size: 12px;
  }

  .nav-button small {
    display: none;
  }

  .main-content {
    width: 100%;
    margin-left: 0;
    padding: 18px 14px 22px;
  }

  .topbar {
    display: block;
  }

  .topbar-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }

  .topbar-meta div {
    min-width: 0;
  }

  .filter-heading {
    align-items: flex-end;
  }

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

  .field-control input,
  .field-control select,
  .multi-select summary,
  .reset-button {
    height: 46px;
    font-size: 16px;
  }

  .field-control > span,
  .multi-select summary > span {
    font-size: 11px;
  }

  .multi-select summary strong {
    font-size: 13px;
  }

  .select-popover,
  .select-popover.wide {
    position: fixed;
    inset: auto 12px calc(78px + env(safe-area-inset-bottom)) 12px;
    width: auto;
    max-height: min(55dvh, 420px);
  }

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

  .operation-metric-board {
    grid-template-columns: 1fr;
  }

  .operation-metric-list {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 120px;
  }

  .two-columns,
  .store-board,
  .model-board {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading p {
    display: none;
  }

  .channel-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quadrant-chart {
    min-height: 280px;
  }

  .toast {
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .topbar h1 {
    font-size: 27px;
  }

  .topbar-meta {
    grid-template-columns: 1fr;
  }

  .filter-heading {
    display: block;
  }

  .date-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 12px;
  }

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

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

  .kpi-card {
    min-height: 112px;
  }

  .bar-row {
    grid-template-columns: minmax(78px, 0.8fr) minmax(80px, 1.5fr) auto;
  }

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

  .page-footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.direct-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.single-store-board {
  grid-template-columns: minmax(280px, 420px);
}

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

.room-line-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.room-line-card summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  list-style: none;
}

.room-line-card summary::-webkit-details-marker {
  display: none;
}

.room-line-card summary strong,
.room-line-card summary small,
.room-line-card summary b {
  display: block;
}

.room-line-card summary small {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 11px;
}

.room-line-card summary b {
  min-width: 86px;
  padding: 7px 10px;
  border: 1px solid #cbdaf8;
  border-radius: 8px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 12px;
  text-align: center;
}

.room-line-card[open] summary {
  background: var(--color-surface-subtle);
}

.room-line-card[open] summary b {
  color: var(--color-muted);
  background: #fff;
}

.compact-table {
  min-width: 680px;
}

.channel-total {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(120px, 1fr) minmax(180px, 1.5fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 12px;
  background: var(--color-primary-soft);
}

.channel-total strong,
.channel-total span,
.channel-total small {
  display: block;
}

.channel-total span {
  color: var(--color-primary-strong);
  font-size: 20px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.channel-total small {
  color: var(--color-muted);
  font-size: 11px;
}

.anchor-panel-card {
  display: grid;
  gap: 14px;
}

.anchor-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(220px, 1fr);
  align-items: end;
  gap: 10px;
}

.switch-line {
  display: grid;
  min-height: 42px;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-subtle);
}

.switch-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.switch-line b,
.switch-line small {
  display: block;
}

.switch-line b {
  font-size: 12px;
}

.switch-line small {
  color: var(--color-muted);
  font-size: 10px;
}

.anchor-tab-panel {
  display: none;
}

.anchor-tab-panel.active {
  display: block;
}

.protected-panel {
  position: relative;
}

.password-gate {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.45fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.92)),
    var(--color-surface-subtle);
}

.password-gate[hidden] {
  display: none;
}

.password-gate h3,
.password-gate p {
  margin: 0;
}

.password-gate h3 {
  margin-top: 4px;
  font-size: 18px;
}

.password-gate p {
  margin-top: 5px;
  color: var(--color-muted);
  font-size: 11px;
}

.password-gate > small {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 750;
}

.password-gate > small.error {
  color: var(--color-accent);
}

.anchor-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.anchor-overview-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary-soft), #fff);
}

.anchor-overview-card span,
.anchor-overview-card strong,
.anchor-overview-card small {
  display: block;
}

.anchor-overview-card span {
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 750;
}

.anchor-overview-card strong {
  overflow: hidden;
  margin-top: 4px;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.anchor-overview-card small {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 9px;
}

.anchor-control-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(150px, 0.4fr) 1fr;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-subtle);
}

.anchor-control-row p {
  margin: 0;
  color: var(--color-muted);
  font-size: 11px;
}

.anchor-ranking-list {
  display: grid;
  gap: 9px;
}

.anchor-ranking-list.compact {
  gap: 8px;
}

.anchor-rank-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.anchor-rank-card.expanded {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.06);
}

.anchor-rank-main {
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: 44px minmax(120px, 1.3fr) 0.55fr 0.9fr 0.75fr 0.85fr 0.75fr;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 0;
  color: var(--color-foreground);
  background: transparent;
  text-align: left;
}

.anchor-rank-main:hover {
  background: var(--color-primary-soft);
}

.anchor-rank-main > span,
.anchor-efficiency-card > span {
  min-width: 0;
}

.anchor-rank-main b,
.anchor-rank-main small,
.anchor-efficiency-card b,
.anchor-efficiency-card small,
.anchor-person strong,
.anchor-person small {
  display: block;
}

.rank-number {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 12px;
  font-weight: 850;
  place-items: center;
}

.anchor-person strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anchor-person small {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 10px;
}

.anchor-rank-main b,
.anchor-efficiency-card b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.anchor-rank-main small,
.anchor-efficiency-card small {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 9px;
}

.status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--color-success);
  background: rgba(15, 139, 116, 0.09);
  font-style: normal;
  font-weight: 800;
}

.status-badge.muted {
  color: var(--color-muted);
  background: var(--color-grid);
}

.anchor-inline-detail {
  padding: 0 12px 12px;
}

.anchor-inline-detail .table-scroll {
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.anchor-efficiency-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.anchor-efficiency-layout h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.anchor-efficiency-card {
  display: grid;
  grid-template-columns: 42px minmax(110px, 1.25fr) repeat(4, minmax(76px, 0.8fr));
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.anchor-level-summary {
  display: grid;
  gap: 9px;
}

.anchor-level-card {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) repeat(6, minmax(58px, 1fr));
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-subtle);
}

.anchor-level-card strong {
  font-size: 12px;
}

.anchor-level-card span,
.anchor-level-card b {
  display: block;
}

.anchor-level-card span {
  color: var(--color-muted);
  font-size: 9px;
}

.anchor-level-card b {
  overflow: hidden;
  margin-top: 2px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.anchor-detail-drawer {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.anchor-detail-drawer summary {
  padding: 12px 14px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.period-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) minmax(130px, 0.4fr) 1fr;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-subtle);
}

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

.data-table th,
.data-table td {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .direct-filter-grid,
  .anchor-toolbar,
  .password-gate,
  .anchor-overview-grid,
  .anchor-control-row,
  .anchor-efficiency-layout,
  .period-toolbar,
  .channel-total-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anchor-rank-main,
  .anchor-efficiency-card {
    grid-template-columns: 42px minmax(120px, 1.4fr) repeat(2, minmax(86px, 1fr));
  }

  .anchor-rank-main > span:nth-child(n + 6) {
    display: none;
  }

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

@media (max-width: 720px) {
  .direct-filter-grid,
  .anchor-toolbar,
  .password-gate,
  .anchor-overview-grid,
  .anchor-control-row,
  .anchor-efficiency-layout,
  .period-toolbar,
  .channel-total,
  .channel-total-hero,
  .channel-sales-row {
    grid-template-columns: 1fr;
  }

  .anchor-rank-main,
  .anchor-efficiency-card {
    grid-template-columns: 38px minmax(0, 1fr) minmax(90px, auto);
  }

  .anchor-rank-main > span:nth-child(n + 4),
  .anchor-efficiency-card > span:nth-child(n + 4) {
    display: none;
  }

  .anchor-level-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-store-board {
    grid-template-columns: 1fr;
  }

}
