:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --page: #f8fafc;
  --line: #e5e7eb;
  --muted: #6b7280;
  --soft: #9ca3af;
  --text: #111827;
  --purple: #5b5ce2;
  --teal: #27c5c6;
  --orange: #f59e0b;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  background: transparent;
}

.browser-shell {
  --sidebar-width: 254px;
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: grid-template-columns 180ms ease;
}

.browser-shell.is-sidebar-collapsed {
  --sidebar-width: 84px;
}

.browser-strip {
  display: none;
}

.window-dots {
  position: absolute;
  left: 24px;
  top: 19px;
  display: flex;
  gap: 8px;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.address-bar {
  position: absolute;
  left: 416px;
  top: 12px;
  width: 500px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
}

.sidebar {
  position: relative;
  grid-row: 1 / span 2;
  grid-column: 1;
  width: var(--sidebar-width);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--line);
  transition: width 180ms ease;
}

.brand {
  position: absolute;
  left: 22px;
  top: 20px;
  display: flex;
  align-items: center;
  max-width: 170px;
  overflow: hidden;
  transition: max-width 180ms ease;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-name {
  margin-left: 7px;
  color: var(--purple);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 140ms ease, width 180ms ease;
}

.sidebar-toggle {
  position: absolute;
  right: 18px;
  top: 20px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.03);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.sidebar-toggle:hover {
  color: #111827;
  border-color: #d1d5db;
  background: #f8fafc;
}

.sidebar-toggle .lucide-icon {
  width: 16px;
  height: 16px;
}

.nav-group-label {
  position: absolute;
  left: 24px;
  top: 84px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 600;
}

.nav-list {
  position: absolute;
  left: 18px;
  top: 108px;
  width: 218px;
  transition: left 180ms ease, width 180ms ease;
}

.nav-item {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #111827;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 6px;
  white-space: nowrap;
  transition: width 180ms ease, padding 180ms ease, gap 180ms ease;
}

.nav-item span:not(.lucide-icon) {
  overflow: hidden;
  transition: opacity 140ms ease, width 180ms ease;
}

.nav-item.active {
  background: #f3f4f6;
  font-weight: 500;
}

.nav-divider {
  width: 206px;
  height: 1px;
  margin: 13px 0 20px 6px;
  background: var(--line);
  transition: width 180ms ease, margin 180ms ease, opacity 140ms ease;
}

.browser-shell.is-sidebar-collapsed .brand {
  left: 16px;
  max-width: 30px;
}

.browser-shell.is-sidebar-collapsed .brand-name,
.browser-shell.is-sidebar-collapsed .nav-group-label,
.browser-shell.is-sidebar-collapsed .nav-item span:not(.lucide-icon) {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.browser-shell.is-sidebar-collapsed .nav-list {
  left: 18px;
  width: 48px;
}

.browser-shell.is-sidebar-collapsed .nav-item {
  width: 48px;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.browser-shell.is-sidebar-collapsed .nav-divider {
  width: 28px;
  margin: 13px 0 20px 10px;
  opacity: 0.75;
}

.icon,
.search-icon,
.calendar-icon,
.filter-icon,
.download-icon,
.receipt-icon,
.clipboard-icon,
.coin-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #4b5563;
}

.lucide-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #6b7280;
  line-height: 0;
}

.lucide-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
}

.nav-item.active .lucide-icon {
  color: #111827;
}

.ghost-button .lucide-icon {
  width: 15px;
  height: 15px;
}

.metric-icon .lucide-icon {
  width: 17px;
  height: 17px;
}

.card-title-icon {
  width: 17px;
  height: 17px;
  color: #64748b;
}

.grid-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 6px 6px,
    linear-gradient(currentColor 0 0) 10px 0 / 6px 6px,
    linear-gradient(currentColor 0 0) 0 10px / 6px 6px,
    linear-gradient(currentColor 0 0) 10px 10px / 6px 6px;
  background-repeat: no-repeat;
  border-radius: 2px;
}

.bars-icon::before,
.nodes-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 3px;
  height: 10px;
  background: currentColor;
  box-shadow: 5px -4px 0 currentColor, 10px -8px 0 currentColor;
  border-radius: 2px;
}

.truck-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 10px;
  height: 6px;
  border: 1.8px solid currentColor;
  border-radius: 2px;
}

.truck-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 7px;
  width: 5px;
  height: 4px;
  border: 1.8px solid currentColor;
  border-left: 0;
  border-radius: 0 2px 2px 0;
  box-shadow: -7px 7px 0 -5px currentColor, 2px 7px 0 -5px currentColor;
}

.bag-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 5px;
  width: 10px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.bag-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 5px;
  border: 1.8px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.users-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 5px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
  box-shadow: -5px 2px 0 -1px #ffffff, -5px 2px 0 0 currentColor;
}

.users-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 2px;
  width: 11px;
  height: 6px;
  border: 1.8px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.log-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 9px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.log-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 7px;
  width: 7px;
  height: 7px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}

.key-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 7px;
  width: 7px;
  height: 7px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}

.key-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px 3px 0 -0.2px currentColor;
}

.topbar {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  height: 58px;
  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.search {
  position: relative;
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #374151;
  background: transparent;
  font-size: 13px;
}

.search input::placeholder {
  color: #6b7280;
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 6px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
}

.sync-button {
  position: relative;
  justify-self: end;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sync-button:hover {
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

.sync-button:focus-visible {
  outline: 3px solid rgba(91, 92, 226, 0.16);
  outline-offset: 3px;
}

.sync-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 48%, transparent 50%),
    conic-gradient(#d1d5db 0 360deg);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.04);
}

.sync-button[data-state="idle"] .sync-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 48%, transparent 50%),
    conic-gradient(#d1d5db 0 360deg);
}

.sync-button[data-state="error"] .sync-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 48%, transparent 50%),
    conic-gradient(#ef4444 0 360deg);
}

.sync-button[data-state="done"] .sync-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 48%, transparent 50%),
    conic-gradient(var(--purple) 0 360deg);
}

.sync-button[data-state="syncing"] .sync-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 48%, transparent 50%),
    conic-gradient(#f59e0b var(--sync-progress), #fef3c7 0);
  animation: sync-progress 1100ms linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@property --sync-progress {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes sync-progress {
  from {
    --sync-progress: 0deg;
  }
  to {
    --sync-progress: 360deg;
  }
}

.user-block {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
}

.user-role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.avatar {
  width: 32px;
  height: 32px;
  background: var(--orange);
  border-radius: 50%;
}

.logout-button {
  height: 30px;
  padding: 0 11px;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.logout-button:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.22);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
  transform: translateY(-1px);
}

.logout-button:focus-visible {
  outline: 3px solid rgba(239, 68, 68, 0.16);
  outline-offset: 3px;
}

.content {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  height: calc(100vh - 58px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 30px 56px;
  background: var(--page);
}

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

.content-heading h1 {
  position: static;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
}

.actions {
  position: static;
  display: flex;
  gap: 8px;
}

.ghost-button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #374151;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.ghost-button:first-child {
  width: 158px;
}

.ghost-button:nth-child(2),
.ghost-button:nth-child(3) {
  width: 82px;
}

.calendar-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 12px;
  height: 11px;
  border: 1.8px solid currentColor;
  border-radius: 2px;
}

.calendar-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 2px;
  height: 5px;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor, 0 7px 0 -0.5px currentColor, 4px 7px 0 -0.5px currentColor, 8px 7px 0 -0.5px currentColor;
}

.filter-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.filter-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 4px;
  height: 4px;
  background: var(--panel);
  border: 1.6px solid currentColor;
  border-radius: 50%;
  box-shadow: 7px 5px 0 -1px var(--panel), 7px 5px 0 0 currentColor, 2px 10px 0 -1px var(--panel), 2px 10px 0 0 currentColor;
}

.download-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 2px;
  height: 9px;
  background: currentColor;
}

.download-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.kpi-row {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.metric-card {
  position: relative;
  height: 92px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.04);
}

.metric-head {
  position: absolute;
  left: 22px;
  top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.metric-icon {
  position: relative;
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: transparent;
}

.receipt-icon::before,
.clipboard-icon::before,
.coin-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-radius: 2px;
}

.receipt-icon::after,
.clipboard-icon::after,
.coin-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  width: 6px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.coin-icon::before {
  border-radius: 50%;
}

.coin-icon::after {
  left: 7px;
  top: 4px;
  width: 2px;
  height: 10px;
  box-shadow: none;
}

.metric-label {
  color: #111827;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.15;
}

.metric-value {
  position: absolute;
  left: 22px;
  top: 50px;
  margin-top: 0;
  color: #111827;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.05;
}

.metric-delta {
  position: absolute;
  right: 19px;
  top: 50px;
  min-width: 66px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 8px;
  text-align: center;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
}

.metric-delta::after {
  font-size: 10px;
  line-height: 1;
}

.metric-delta.delta-up {
  color: #047857;
  background: #dff8ec;
}

.metric-delta.delta-up::after {
  content: "↗";
}

.metric-delta.delta-down {
  color: #be123c;
  background: #ffe4e6;
}

.metric-delta.delta-down::after {
  content: "↘";
}

.metric-delta.delta-neutral {
  color: #6b7280;
  background: #f3f4f6;
}

.metric-delta.delta-neutral::after {
  content: "";
}

.dashboard-grid {
  position: static;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(250px, 340fr) minmax(0, 310fr) minmax(250px, 340fr);
  gap: 24px;
}

.card {
  --card-content-x: 22px;
  --card-content-top: 76px;
  --card-content-bottom: 24px;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.04);
}

.card h2 {
  position: absolute;
  left: 22px;
  top: 22px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.15;
}

.sales-card {
  grid-column: 1 / span 2;
  grid-row: 1;
  width: auto;
  height: auto;
  min-height: 320px;
  transition: min-height 180ms ease;
}

.chart-period-control {
  position: absolute;
  right: 18px;
  top: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
}

.chart-period-control::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.6px solid #6b7280;
  border-bottom: 1.6px solid #6b7280;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.chart-period-control select {
  width: 82px;
  height: 32px;
  padding: 0 28px 0 12px;
  color: #374151;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  appearance: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 32px;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.03);
}

.chart-period-control select:focus {
  border-color: rgba(91, 92, 226, 0.55);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.12);
}

.source-card {
  grid-column: 3;
  grid-row: 1;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  align-self: start;
}

.card-total {
  position: absolute;
  left: 22px;
  top: 50px;
  color: #111827;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.sales-card .bar-chart {
  top: 92px;
}

.product-card {
  grid-column: 2 / span 2;
  grid-row: 2;
  width: auto;
  height: auto;
  min-height: 260px;
  transition: min-height 180ms ease;
}

.trend-card {
  grid-column: 1;
  grid-row: 2;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  align-self: start;
  transition: min-height 180ms ease;
}

.bar-chart {
  position: absolute;
  left: var(--card-content-x);
  right: var(--card-content-x);
  top: var(--card-content-top);
  bottom: var(--card-content-bottom);
  width: auto;
  height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.bar-chart::-webkit-scrollbar {
  height: 6px;
}

.bar-chart::-webkit-scrollbar-track {
  background: transparent;
}

.bar-chart::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 99px;
}

.bar-track {
  position: relative;
  width: 100%;
  min-width: 100%;
  height: calc(100% - 8px);
}

.gridline {
  position: absolute;
  left: 5.54%;
  width: 88.46%;
  height: 1px;
  background: #eef2f7;
}

.line-1 {
  top: 32.5%;
}

.line-2 {
  top: 46.25%;
}

.line-3 {
  top: 60%;
}

.line-4 {
  top: 73.75%;
}

.bar-shell {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(18px, 3.69%, 30px);
  height: var(--height);
}

.bar-shell.is-clickable {
  cursor: pointer;
}

.bar-shell.is-clickable:focus-visible {
  outline: 2px solid rgba(91, 92, 226, 0.45);
  outline-offset: 6px;
  border-radius: 10px;
}

.week-bar-shell {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.week-bar-shell .bar {
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.week-bar-shell:hover .bar,
.week-bar-shell.is-selected .bar {
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.14);
  transform: translateY(-2px);
}

.week-bar-shell.is-selected .bar-label {
  color: var(--purple);
  font-weight: 700;
}

.week-sales-chart .bar-track {
  height: calc(100% - 8px);
}

.source-card .week-sales-chart {
  top: 92px;
}

.week-sales-chart .bar-shell {
  width: clamp(20px, 7.3%, 28px);
}

.week-sales-chart .bar {
  border-radius: 8px;
  background: linear-gradient(180deg, #4438d5 0%, #5b5ce2 36%, #8a7cff 68%, #c8c4ff 100%);
}

.week-sales-chart .bar-segment {
  background: transparent;
  border-radius: 0;
}

.week-sales-chart .bar.is-zero {
  background: transparent;
}

.week-sales-chart .bar-zero-fill {
  background: #d1d5db;
  border-radius: 8px;
}

.week-sales-chart .bar-label {
  left: 50%;
  transform: translateX(-50%);
}

.bar {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #edf1f5;
  border-radius: 6px 6px 2px 2px;
}

.sales-card .bar {
  gap: 3px;
  border-radius: 8px;
  background: transparent;
}

.sales-card .payment-segment {
  border-radius: 8px;
}

.sales-card .segment-wechat {
  background: #18c8c0;
}

.sales-card .segment-alipay {
  background: #4b92f5;
}

.sales-card .segment-mini-program {
  background: #7fe6df;
}

.bar.is-zero {
  background: transparent;
}

.sales-card .bar.is-zero {
  background: transparent;
}

.bar-segment {
  display: block;
  width: 100%;
  min-height: 0;
}

.bar-segment-online {
  order: 1;
  background: var(--purple);
  border-radius: 6px 6px 0 0;
}

.bar-segment-offline {
  order: 2;
  background: var(--teal);
  border-radius: 0 0 2px 2px;
}

.bar.is-offline-only .bar-segment-offline,
.bar.is-online-only .bar-segment-online {
  border-radius: 6px 6px 2px 2px;
}

.bar-zero-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #d1d5db;
  border-radius: 6px 6px 2px 2px;
}

.sales-card .bar-zero-fill {
  border-radius: 8px;
}


.bar-amount {
  position: absolute;
  left: 0;
  top: -14px;
  width: 100%;
  overflow: hidden;
  color: #94a3b8;
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.bar-label {
  position: absolute;
  left: -2px;
  top: calc(100% + 16px);
  color: #6b7280;
  font-size: 10px;
  font-weight: 500;
  transform: none;
  white-space: nowrap;
}

.donut-layout {
  position: absolute;
  left: var(--card-content-x);
  right: var(--card-content-x);
  top: var(--card-content-top);
  bottom: var(--card-content-bottom);
  width: auto;
  height: auto;
}

.donut {
  position: absolute;
  left: 50%;
  top: 76px;
  width: clamp(168px, 55%, 260px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  background: conic-gradient(#ffffff 0 0.8%, var(--purple) 0.8% 56.6%, #ffffff 56.6% 58%, #e5e7eb 58% 70.8%, #ffffff 70.8% 72.2%, var(--teal) 72.2% 99.2%, #ffffff 99.2% 100%);
  transform: translateX(-50%);
  transform-origin: center;
}

.donut::before {
  content: "";
  position: absolute;
  inset: 35px;
  background: var(--panel);
  border-radius: 50%;
}

.donut-center {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
}

.legend {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.legend div {
  display: grid;
  grid-template-columns: 8px auto auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 0;
  color: #4b5563;
  font-size: 12px;
  font-weight: 500;
}

.legend strong {
  text-align: right;
  color: #111827;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.online {
  background: var(--purple);
}

.dot.offline {
  background: var(--teal);
}

.dot.other {
  background: #d6dbe3;
}

.product-table {
  position: absolute;
  left: var(--card-content-x);
  top: var(--card-content-top);
  right: var(--card-content-x);
  bottom: var(--card-content-bottom);
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.table-head {
  position: static;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 64px minmax(120px, 1fr) 52px 68px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  align-items: center;
}

.table-head span:nth-child(3) {
  grid-column: 3 / span 2;
}

.table-head span:nth-child(4) {
  grid-column: 5;
  text-align: right;
}

.product-card h2,
.trend-card h2 {
  top: 21px;
}

.product-row {
  position: static;
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 64px minmax(120px, 1fr) 52px 68px;
  align-items: center;
  color: #334155;
  font-size: 13px;
  font-weight: 400;
}

.product-table-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.product-table-body::-webkit-scrollbar {
  width: 6px;
}

.product-table-body::-webkit-scrollbar-track {
  background: transparent;
}

.product-table-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 99px;
}

.product-row strong {
  text-align: right;
  color: #334155;
  font-weight: 400;
}

.product-name {
  color: #334155;
  font-weight: 400;
}

.progress {
  position: relative;
  width: 100%;
  height: 9px;
  background: #edf1f5;
  border-radius: 99px;
}

.progress i {
  display: block;
  height: 9px;
  background: var(--purple);
  border-radius: 99px;
}

.progress.teal i {
  background: var(--teal);
}

.progress.violet i {
  background: #7c4dff;
}

.progress.green i {
  background: #10b981;
}

.progress.amber i {
  background: #f59e0b;
}

.percent {
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
}

.trend-content {
  position: absolute;
  left: var(--card-content-x);
  top: var(--card-content-top);
  right: var(--card-content-x);
  bottom: var(--card-content-bottom);
}

.line-chart {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(100% - 44px);
  overflow: visible;
}

.browser-shell.is-sidebar-collapsed .sales-card {
  min-height: 360px;
}

.browser-shell.is-sidebar-collapsed .product-card {
  min-height: 285px;
}

.trend-grid line {
  stroke: #eef2f7;
  stroke-width: 1;
}

.trend-price text {
  fill: #374151;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 600;
}

.trend-time text {
  fill: #6b7280;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 500;
}

.trend-detail {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
}

.trend-detail span {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: #374151;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 10px 14px;
  color: #fff;
  background: #111827;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

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

.filter-modal[hidden] {
  display: none;
}

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

.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 78px 34px 0 0;
  background: rgba(17, 24, 39, 0.16);
}

.date-modal {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 78px 184px 0 0;
  background: rgba(17, 24, 39, 0.08);
}

.filter-panel {
  width: 320px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 52px rgba(17, 24, 39, 0.14);
}

.date-panel {
  width: 332px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 52px rgba(17, 24, 39, 0.14);
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.filter-head h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 600;
}

.filter-head button {
  width: 28px;
  height: 28px;
  color: #6b7280;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.filter-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-field span {
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}

.filter-field select,
.filter-field input {
  height: 38px;
  padding: 0 12px;
  color: #111827;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  font-size: 13px;
}

.date-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.date-presets button {
  height: 34px;
  color: #374151;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
}

.date-presets button.is-active {
  color: #ffffff;
  background: var(--purple);
  border-color: var(--purple);
}

.date-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.filter-actions button {
  height: 38px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}

.filter-actions button:first-child {
  color: #374151;
  background: #ffffff;
  border: 1px solid var(--line);
}

.filter-actions button:last-child {
  color: #ffffff;
  background: var(--purple);
  border: 1px solid var(--purple);
}

.product-row {
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.product-row:hover {
  background: #f8fafc;
}

.product-row.is-selected {
  color: #111827;
}

.empty-state {
  position: absolute;
  inset: var(--card-content-top) var(--card-content-x) var(--card-content-bottom);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
}

.product-table .empty-state {
  position: static;
  grid-column: 1 / -1;
  min-height: 150px;
}

@media (max-width: 1350px) {
  body {
    padding: 0;
  }
}

@media (max-width: 1350px) and (min-width: 1021px) {
  .dashboard-grid {
    grid-template-columns: minmax(250px, 340fr) minmax(0, 310fr) minmax(250px, 340fr);
  }
}

@media (max-width: 1020px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .sales-card,
  .source-card,
  .product-card,
  .trend-card {
    grid-column: 1;
    grid-row: auto;
  }

  .source-card {
    height: 300px;
  }

  .legend {
    left: 180px;
  }
}

@media (max-width: 1180px) {
  .browser-shell {
    --sidebar-width: 220px;
  }

  .browser-shell.is-sidebar-collapsed {
    --sidebar-width: 84px;
  }

  .nav-list {
    width: 184px;
  }

  .browser-shell.is-sidebar-collapsed .nav-list {
    width: 48px;
  }

  .topbar {
    padding-right: 18px;
    padding-left: 18px;
  }

  .content {
    padding-right: 24px;
    padding-left: 24px;
  }

  .kpi-row {
    gap: 16px;
  }

  .metric-delta {
    right: 14px;
    min-width: 58px;
  }
}

@media (max-width: 1020px) {
  .kpi-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .metric-card {
    min-height: 92px;
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    overflow-y: auto;
    padding: 0;
  }

  .stage {
    height: auto;
    min-height: 0;
  }

  .browser-shell {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand,
  .nav-group-label,
  .nav-list {
    position: static;
  }

  .brand {
    margin-bottom: 14px;
  }

  .nav-group-label {
    margin-bottom: 8px;
  }

  .nav-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-item {
    width: auto;
    height: 34px;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .nav-divider {
    display: none;
  }

  .topbar {
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 14px 16px;
  }

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

  .sync-button {
    grid-column: 1;
    justify-self: start;
  }

  .user-block {
    grid-column: 2;
  }

  .content {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 20px 16px 28px;
  }

  .content-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 18px;
  }

  .actions {
    flex-wrap: wrap;
  }

  .ghost-button:first-child,
  .ghost-button:nth-child(2),
  .ghost-button:nth-child(3) {
    width: auto;
  }

  .dashboard-grid {
    gap: 16px;
  }

  .sales-card {
    overflow-x: auto;
  }

  .source-card {
    min-height: 300px;
    overflow: hidden;
  }

  .product-card {
    overflow: hidden;
  }

  .trend-card {
    overflow: hidden;
  }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .sync-button,
  .user-block {
    grid-column: 1;
  }

  .user-block {
    justify-self: start;
  }

  .metric-value {
    left: 58px;
    font-size: 21px;
  }

  .metric-delta {
    top: 54px;
  }

  .sales-card {
    height: 310px;
  }

  .source-card {
    height: 330px;
  }

  .product-card {
    height: 228px;
  }

  .table-head {
    grid-template-columns: minmax(82px, 1.2fr) 38px minmax(92px, 1fr) 48px;
  }

  .product-row {
    grid-template-columns: minmax(82px, 1.2fr) 38px minmax(58px, 1fr) 34px 48px;
    font-size: 11px;
  }

  .percent {
    font-size: 10px;
  }

  .trend-card {
    height: 230px;
  }

  .trend-detail {
    flex-wrap: wrap;
  }
}
