:root {
  --ink: #24232b;
  --muted: #918da8;
  --subtle: #f3f2f8;
  --panel: #ffffff;
  --line: #eceaf4;
  --purple: #7b00f5;
  --purple-soft: #eee5ff;
  --yellow: #ffc400;
  --coral: #ff7648;
  --green: #39c9a6;
  --blue: #6b6ff7;
  --lavender: #f6f4ff;
  --shadow: 0 18px 42px rgba(39, 36, 55, 0.06);
  --radius-xl: 22px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body,
button,
input {
  -webkit-font-smoothing: antialiased;
  font-family: "Aptos", "Avenir Next", "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--subtle);
}

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

.sidebar {
  background: var(--panel);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 26px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 62px;
}

.crest {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  color: white;
  background:
    radial-gradient(circle at 72% 24%, var(--coral) 0 22%, transparent 23%),
    radial-gradient(circle at 34% 72%, var(--yellow) 0 27%, transparent 28%),
    linear-gradient(135deg, var(--purple), var(--blue));
  font-size: 0;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand .eyebrow {
  display: none;
}

nav {
  display: grid;
  gap: 22px;
}

nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

nav a::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 6px;
  opacity: 0.7;
}

nav a.active,
nav a:hover {
  color: var(--purple);
}

nav a.active::after {
  content: "";
  position: absolute;
  right: -27px;
  width: 4px;
  height: 34px;
  border-radius: 999px;
  background: var(--purple);
}

.analyst-card {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 32px;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(145deg, #7b00f5, #6414dd);
}

.analyst-card::before {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.analyst-card .eyebrow,
.analyst-card p {
  color: rgba(255, 255, 255, 0.78);
}

.analyst-card h2 {
  margin: 0;
  font-size: 18px;
}

.analyst-card p:last-child {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.45;
}

.pulse {
  display: none;
}

main {
  min-width: 0;
  padding: 38px 28px 46px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 354px);
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.045em;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  height: 46px;
  overflow: hidden;
  border-radius: 10px;
  background: #e9e8fb;
}

.search-box input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 18px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box span {
  display: grid;
  width: 52px;
  height: 46px;
  place-items: center;
  color: white;
  background: var(--purple);
  font-size: 22px;
  font-weight: 800;
}

.filters {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filters span {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.metric-grid,
.layout-three,
.layout-two,
.source-panel,
.dashboard-insights {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

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

.layout-two {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.95fr);
}

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

.dashboard-insights {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.source-panel,
.panel,
.metric,
.insight-card {
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.source-panel {
  grid-template-columns: minmax(220px, 0.68fr) minmax(0, 1.32fr);
  align-items: center;
  padding: 18px 20px;
}

.source-panel h3,
.panel h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.source-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.source-filter {
  cursor: pointer;
  max-width: 260px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: #f4f2fb;
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-filter.active {
  color: white;
  background: var(--purple);
}

.metric {
  position: relative;
  min-height: 132px;
  padding: 22px;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: 26px;
  top: 28px;
  width: 58px;
  height: 58px;
  border: 6px solid #eceef8;
  border-right-color: currentColor;
  border-radius: 50%;
  opacity: 0.95;
}

.metric:nth-child(1) { color: var(--purple); }
.metric:nth-child(2) { color: var(--yellow); }
.metric:nth-child(3) { color: var(--coral); }
.metric:nth-child(4) { color: var(--green); }
.metric:nth-child(5) { color: var(--blue); }

.metric .eyebrow {
  color: var(--muted);
  font-size: 14px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.045em;
}

.metric span {
  display: inline-flex;
  margin-top: 10px;
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
}

.panel {
  padding: 22px;
}

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

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.line-chart {
  min-height: 286px;
}

.line-chart svg {
  width: 100%;
  height: 286px;
  overflow: visible;
}

.axis {
  stroke: #f0eef7;
  stroke-width: 1;
}

.sales-line {
  fill: none;
  stroke: var(--purple);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.pax-line {
  fill: none;
  stroke: var(--coral);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.bars,
.rank-list,
.signal-grid {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta,
.rank-item,
.signal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
}

.bar-meta span,
.rank-item span,
.signal span {
  color: var(--muted);
  font-weight: 700;
}

.track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0eff8;
}

.fill {
  height: 100%;
  border-radius: 999px;
  background: var(--purple);
}

.rank-item,
.signal {
  padding: 9px 0;
  border-bottom: 1px solid #f0eef7;
}

.rank-item:last-child,
.signal:last-child {
  border-bottom: 0;
}

pre {
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.insight-card {
  padding: 20px;
}

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

.side-head h3 {
  margin: 0;
  font-size: 17px;
}

.side-head span {
  display: grid;
  min-width: 34px;
  min-height: 30px;
  padding: 0 10px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--purple);
  font-weight: 800;
}

.file-list,
.snapshot-list,
.reminder-list {
  display: grid;
  gap: 12px;
}

.file-pill {
  cursor: pointer;
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--coral);
  text-align: left;
}

.file-pill:nth-child(2n) {
  background: var(--purple);
}

.file-pill span {
  display: grid;
  height: 50px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 22px;
  font-weight: 850;
}

.file-pill strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-item,
.reminder-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #f0eef7;
}

.snapshot-item span,
.reminder-item p {
  color: var(--muted);
}

.snapshot-item strong {
  color: var(--ink);
}

.reminder-item {
  justify-content: flex-start;
}

.reminder-item > span {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--purple-soft);
}

.reminder-item.tone-2 > span {
  background: #fff4c7;
}

.reminder-item.tone-3 > span {
  background: #dff7ee;
}

.reminder-item strong {
  display: block;
  margin-bottom: 4px;
}

.reminder-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 1280px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .dashboard-insights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 20px;
  }

  .brand {
    margin-bottom: 18px;
  }

  nav {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  nav a.active::after {
    display: none;
  }

  .analyst-card {
    display: none;
  }

  main {
    padding: 24px 18px 34px;
  }

  .topbar,
  .source-panel,
  .dashboard-insights,
  .layout-two,
  .layout-three {
    grid-template-columns: 1fr;
  }

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

  .source-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 14px;
  }

  .search-box {
    max-width: 100%;
  }

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

  .metric,
  .panel,
  .source-panel {
    border-radius: 16px;
  }

  .bar-meta,
  .rank-item,
  .signal {
    flex-direction: column;
    gap: 5px;
  }
}
