:root {
  --bg: #f7f8f7;
  --panel: #ffffff;
  --panel-soft: #f1f5f2;
  --ink: #111827;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #dfe5e2;
  --line-soft: #ebefed;
  --nav: #0e1b24;
  --nav-2: #132633;
  --teal: #16a085;
  --teal-soft: #e7f7f2;
  --coral: #e95544;
  --amber: #f4a51c;
  --blue: #2563eb;
  --gray: #aab2bc;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--ink);
  background: var(--bg);
}

button,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  color: #f8fafc;
  background:
    linear-gradient(180deg, rgba(33, 69, 82, 0.92), rgba(13, 25, 35, 0.98)),
    var(--nav);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 7px 22px;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f5b044;
  color: #07131c;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 760;
}

.brand-sub {
  margin-top: 2px;
  color: #aec1cb;
  font-size: 10px;
  letter-spacing: 0;
}

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

.nav-item {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  color: #dbe8ee;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(31, 154, 141, 0.52), rgba(31, 106, 129, 0.45));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-icon {
  width: 18px;
  height: 18px;
  position: relative;
  flex: none;
}

.calendar-icon {
  border: 1.8px solid currentColor;
  border-radius: 4px;
}

.calendar-icon::before,
.calendar-icon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 5px;
  top: -4px;
  background: currentColor;
}

.calendar-icon::before {
  left: 4px;
}

.calendar-icon::after {
  right: 4px;
}

.trend-icon::before {
  content: "";
  position: absolute;
  inset: 4px 2px 3px 1px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skew(-18deg);
}

.trend-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 1px;
  top: 5px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-28deg);
}

.grid-icon {
  background:
    linear-gradient(currentColor, currentColor) left top / 7px 7px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 7px 7px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 7px 7px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 7px 7px no-repeat;
}

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

.user-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 14px;
  height: 8px;
  border: 1.8px solid currentColor;
  border-radius: 8px 8px 3px 3px;
}

.nav-foot {
  margin-top: auto;
  padding: 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b8c8d1;
  font-size: 12px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(22, 160, 133, 0.18);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 74px;
  padding: 14px 22px 12px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  backdrop-filter: blur(16px);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.topbar h1 {
  font-size: 25px;
  line-height: 1.15;
  font-weight: 780;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select,
.ghost-button,
.primary-button,
.icon-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.select {
  min-width: 136px;
  padding: 0 34px 0 12px;
  font-size: 13px;
}

.ghost-button {
  padding: 0 14px;
  font-weight: 650;
  cursor: pointer;
}

.primary-button {
  padding: 0 14px;
  border-color: #12917a;
  color: #fff;
  background: var(--teal);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.primary-button:disabled {
  border-color: #b7c9c4;
  background: #9ebbb4;
  cursor: progress;
}

.icon-button {
  width: 36px;
  position: relative;
  cursor: pointer;
}

.icon-button::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-left: 2px solid #344054;
  border-bottom: 2px solid #344054;
  transform: rotate(45deg);
  left: 14px;
  top: 12px;
}

.icon-button.next::before {
  transform: rotate(225deg);
  left: 11px;
}

.summary-band {
  padding: 12px 22px;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 76px;
  padding: 11px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

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

.metric-card strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}

.revenue-card strong {
  color: var(--teal);
  font-size: 25px;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 424px;
  border-top: 1px solid var(--line-soft);
}

.calendar-panel {
  min-width: 0;
  padding: 16px 22px 14px;
  border-right: 1px solid var(--line);
}

.calendar-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.calendar-head h2 {
  font-size: 19px;
  font-weight: 760;
}

.calendar-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: 12px;
}

.health {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 5px;
}

.excellent {
  background: var(--teal);
}

.normal {
  background: var(--amber);
}

.watch {
  background: var(--coral);
}

.missing {
  background: var(--gray);
}

.week-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.week-row {
  height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #fff;
}

.week-row span {
  text-align: center;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.calendar-grid {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: #fff;
}

.day-cell {
  min-height: 112px;
  padding: 7px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
}

.day-cell:hover {
  background: #fbfefd;
  box-shadow: inset 0 0 0 1px rgba(22, 160, 133, 0.25);
}

.day-cell.selected {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  background: linear-gradient(180deg, #ffffff, #f2fbf8);
}

.day-cell.outside {
  background: #f6f7f7;
}

.day-cell.outside .day-number,
.day-cell.outside .metric-row {
  opacity: 0.35;
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-number {
  font-size: 19px;
  font-weight: 760;
  line-height: 1;
}

.day-cell.today .day-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 16px;
}

.metric-stack {
  display: grid;
  gap: 1px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.28;
  white-space: nowrap;
}

.metric-row span:first-child {
  color: var(--muted);
}

.metric-row strong {
  font-size: 11px;
  font-weight: 720;
}

.money-row strong {
  color: var(--teal);
}

.detail-panel {
  min-width: 0;
  background: #fff;
  padding: 18px 16px 16px;
  overflow: auto;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.detail-head h2 {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 780;
}

.health-badge {
  height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 720;
}

.health-badge.excellent {
  color: #087864;
  background: var(--teal-soft);
}

.health-badge.normal {
  color: #8a5c00;
  background: #fff4db;
}

.health-badge.watch {
  color: #a53b2d;
  background: #ffebe7;
}

.health-badge.missing {
  color: #58606b;
  background: #eef1f4;
}

.funnel {
  margin: 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
}

.funnel-step {
  min-height: 72px;
  padding: 11px 8px;
  display: grid;
  align-content: center;
  gap: 7px;
  text-align: center;
  border-right: 1px solid var(--line-soft);
}

.funnel-step:last-child {
  border-right: 0;
}

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

.funnel-step strong {
  font-size: 22px;
  line-height: 1;
}

.detail-revenue {
  min-height: 58px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #f3fbf8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-revenue span {
  color: var(--muted);
  font-size: 13px;
}

.detail-revenue strong {
  color: var(--teal);
  font-size: 24px;
}

.detail-section {
  margin-top: 16px;
}

.section-title {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title h3 {
  font-size: 14px;
  font-weight: 760;
}

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

.platform-rows {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.platform-row {
  display: grid;
  grid-template-columns: 78px repeat(4, 1fr);
  gap: 7px;
  min-height: 38px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.platform-row:last-child {
  border-bottom: 0;
}

.platform-row strong {
  font-weight: 760;
}

.platform-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 760;
}

.platform-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.trend-bars {
  height: 96px;
  padding: 9px 8px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
}

.trend-day {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr 16px;
  gap: 4px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}

.bar-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.bar {
  width: 8px;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
}

.bar.orders {
  background: var(--coral);
}

.item-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.list-item {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 4px;
}

.list-item:last-child {
  border-bottom: 0;
}

.list-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}

.list-main span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.empty-state {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.data-foot {
  min-height: 38px;
  padding: 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: #fff;
}

@media (max-width: 1280px) {
  body {
    min-width: 1040px;
  }

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

  .workspace {
    grid-template-columns: minmax(560px, 1fr) 350px;
  }

  .day-cell {
    min-height: 106px;
    padding: 6px;
  }

  .summary-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-panel {
    padding: 16px 12px;
  }

  .platform-row {
    grid-template-columns: 66px repeat(4, 1fr);
    gap: 5px;
    padding: 8px;
  }
}
