.app-root {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar__logo {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.sidebar__brand-name {
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base);
  min-height: 32px;
  text-decoration: none;
}

.sidebar__nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar__nav-item--active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar__nav-item--active:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar__nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar__user {
  padding: var(--space-3);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-weight: 500;
  font-size: var(--fs-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.sidebar__logout {
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  transition: background var(--t-base), color var(--t-base);
}

.sidebar__logout:hover {
  background: var(--bg-elevated);
  color: var(--danger);
}

.sidebar__logout svg {
  width: 16px;
  height: 16px;
}

.main {
  height: 100vh;
  overflow: hidden;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.page__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.page__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.page__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

/* Login */
.login-root {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.08), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.05), transparent 60%),
    var(--bg-base);
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-card__logo {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin: 0 auto var(--space-4);
}

.login-card__title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card__tagline {
  margin: 0 0 var(--space-6);
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.login-card .btn {
  width: 100%;
}

/* Empty/loading states */
.empty-state {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--space-8);
  color: var(--text-muted);
  text-align: center;
  font-size: var(--fs-md);
}

.skeleton-line {
  height: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
