* { box-sizing: border-box; }

:root {
  --purple: #6D28D9;
  --purple-dark: #171522;
  --text: #171522;
  --muted: #777384;
  --line: #e9e6ef;
  --surface: #ffffff;
  --background: #f7f6f9;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

button, a { font: inherit; }

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

.sidebar {
  width: 250px;
  min-height: 100vh;
  padding: 28px 18px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 34px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .25em;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 11px;
  color: #5f5a69;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  background: #f0eaff;
  color: var(--purple);
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 10px 4px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.sidebar-footer span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .18em;
  font-weight: 800;
}

.sidebar-footer strong {
  font-size: 12px;
}

.main {
  flex: 1;
  padding: 34px 42px 60px;
  max-width: 1500px;
}

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

.eyebrow {
  color: var(--purple);
  font-size: 10px;
  letter-spacing: .22em;
  font-weight: 800;
}

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

h1 {
  margin-top: 5px;
  font-size: 31px;
  letter-spacing: -0.045em;
}

.profile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eee9f9;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
}

.welcome {
  margin-top: 34px;
  padding: 30px 32px;
  border-radius: 20px;
  background: #eee9f9;
}

.welcome h2 {
  margin-top: 8px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.welcome p {
  margin-top: 8px;
  color: #696372;
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.stat-card {
  padding: 21px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .15em;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.panel {
  margin-top: 18px;
  padding: 25px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-heading h3 {
  margin-top: 6px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 9px 13px;
  color: #55505f;
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  margin-top: 22px;
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed #d9d4e2;
  border-radius: 13px;
}

.empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eee9f9;
  color: var(--purple);
  font-weight: 800;
}

.empty-state h4 {
  font-size: 14px;
}

.empty-state p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .sidebar { width: 210px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 28px 24px; }
}

@media (max-width: 650px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; min-height: auto; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-footer { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
}
