:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --bg-muted: #1e293b;
  --bg-elevated: rgba(30, 41, 59, 0.75);
  --accent: #38bdf8;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --card-bg: rgba(15, 23, 42, 0.65);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1f2937, #0f172a 55%);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  backdrop-filter: blur(10px);
}

.sidebar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.65));
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand h1 {
  font-size: 1.4rem;
  margin: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.brand__logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.05));
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nav-tree {
  overflow-y: auto;
  padding-right: 8px;
}

.nav-list,
.nav-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list > li + li {
  margin-top: 8px;
}

.nav-sublist {
  margin: 8px 0 12px 16px;
  border-left: 1px solid rgba(148, 163, 184, 0.15);
  padding-left: 16px;
  display: none;
}

.nav-sublist[aria-hidden="false"],
.nav-node[aria-expanded="true"] + .nav-sublist,
.nav-node--child[aria-expanded="true"] + .nav-sublist {
  display: block;
}

.nav-node,
.nav-node--child,
.nav-leaf {
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 0.95rem;
}

.nav-node span {
  font-weight: 600;
}

.nav-node--child {
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-leaf {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-node:hover,
.nav-node--child:hover,
.nav-leaf:hover,
.nav-leaf:focus-visible {
  background: rgba(56, 189, 248, 0.1);
  color: #f1f5f9;
}

.nav-leaf.is-active {
  background: rgba(56, 189, 248, 0.18);
  color: #f8fafc;
}

.workspace {
  background: rgba(15, 23, 42, 0.55);
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.workspace__header h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.workspace__header p {
  margin: 0;
  color: var(--text-muted);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: grid;
  place-items: center;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.user-name {
  margin: 0;
  font-weight: 600;
}

.user-role {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.workspace__content {
  flex: 1;
  overflow-y: auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.35);
}

.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.card p {
  color: var(--text-muted);
}

.card ul {
  padding-left: 18px;
  margin: 12px 0 0;
  color: var(--text);
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 16px 0 0;
}

.stat-list div {
  background: rgba(148, 163, 184, 0.08);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-list dt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-list dd {
  margin: 8px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.timeline__time {
  display: inline-block;
  min-width: 58px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.timeline li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    flex-direction: row;
    overflow-x: auto;
    padding: 16px;
    gap: 16px;
  }

  .nav-tree {
    display: flex;
    flex: 1;
  }

  .nav-list {
    display: flex;
    gap: 12px;
  }

  .nav-sublist {
    display: none !important;
  }
}
