/* Persistent left navigation */
.nav-wrap {
  max-width: none;
  padding: 0 24px;
}
.sidebar {
  position: fixed;
  top: 76px;
  bottom: 0;
  left: 0;
  width: 224px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 12px 20px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-label {
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 12px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
  text-align: left;
  white-space: nowrap;
}
.sidebar-tab > svg {
  width: 16px;
  height: 16px;
}
.sidebar-tab:hover {
  background: color-mix(in srgb, var(--soft) 65%, transparent);
  color: var(--text);
}
.sidebar-tab.active {
  background: var(--soft);
  color: var(--text);
  font-weight: 500;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
main {
  max-width: none;
  margin: 0 0 0 224px;
  padding: 40px 32px 0;
  min-height: calc(100dvh - 76px);
}
.section-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 40px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}
.section-placeholder .empty-icon {
  margin-bottom: 16px;
}
.section-placeholder h2 {
  margin-top: 12px;
  font-size: 18px;
}
.section-placeholder p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.7;
}
.section-soon {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .sidebar {
    width: 192px;
  }
  main {
    margin-left: 192px;
    padding: 32px 24px 0;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .heading-actions {
    justify-content: flex-start;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .nav-wrap {
    padding: 0 16px;
    gap: 12px;
  }
  .brand {
    font-size: 20px;
  }
  .brand-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
  }
  .local-status {
    font-size: 0;
    gap: 0;
  }
  .local-status .status-dot {
    width: 6px;
    height: 6px;
  }
  #theme-toggle {
    margin-left: 0;
  }
  .sidebar {
    top: 64px;
    width: 56px;
    padding: 20px 6px;
    align-items: center;
  }
  .sidebar-label,
  .sidebar-tab-label,
  .sidebar-bottom {
    display: none;
  }
  .sidebar-tabs {
    width: 100%;
    gap: 8px;
  }
  .sidebar-tab {
    justify-content: center;
    min-height: 40px;
    padding: 10px;
    width: 100%;
  }
  .sidebar-tab > svg {
    width: 18px;
    height: 18px;
  }
  main {
    margin-left: 56px;
    padding: 28px 16px 0;
    min-height: calc(100dvh - 64px);
  }
  .section-placeholder {
    min-height: 300px;
    padding: 32px 18px;
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .heading-actions {
    justify-content: flex-start;
  }
  .stats {
    gap: 10px;
  }
  .stat-card {
    padding: 16px 12px;
  }
  .stat-label {
    font-size: 12px;
  }
  .stat-description {
    font-size: 11px;
  }
  .section-placeholder p {
    font-size: 13px;
  }
}
@media (max-width: 380px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .brand {
    font-size: 18px;
  }
  .nav-wrap {
    padding: 0 12px;
  }
  .nav-wrap .local-status {
    display: none;
  }
  .nav-wrap #theme-toggle {
    margin-left: auto;
  }
  .period-panel {
    width: min(296px, calc(100vw - 88px));
  }
  .export-menu {
    width: min(200px, calc(100vw - 110px));
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
}
