.app-layout {
  --layout-sidebar-width: var(--shell-sidebar-width);
  display: block;
  min-height: 100%;
}

.app-layout.is-nav-collapsed {
  --layout-sidebar-width: var(--shell-sidebar-width-collapsed);
}

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--layout-sidebar-width);
  z-index: 55;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 10px 8px 12px;
  border-right: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
  transition: width 0.2s ease, transform 0.2s ease;
}

.side-brand-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.side-brand-logo-img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: none;
  transition: width 0.2s ease, height 0.2s ease;
}

.side-brand-card h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
}

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

.app-layout.is-nav-collapsed .side-brand-card {
  justify-content: center;
  padding: 8px;
}

.app-layout.is-nav-collapsed .side-brand-card > div {
  display: none;
}

.app-layout.is-nav-collapsed .side-brand-logo-img {
  width: 58px;
  height: 58px;
}

.content-area {
  min-width: 0;
  margin-left: var(--layout-sidebar-width);
  transition: margin-left 0.2s ease;
}

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--shell-topbar-height);
  z-index: 50;
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(22, 24, 38, 0.06);
}

.app-layout .app-topbar {
  left: var(--layout-sidebar-width);
  transition: left 0.2s ease;
}

.app-topbar.public-topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.public-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.container {
  width: 100%;
  margin: 0;
  padding: calc(var(--shell-topbar-height) + 20px) 18px 60px;
}

.container.no-auth {
  max-width: 920px;
  margin: 0 auto;
}

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

.logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: none;
}

.brand-block h1 {
  margin: 0;
  font-size: 19px;
}

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

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

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.topbar-head {
  min-width: 0;
}

.topbar-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.topbar-head p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-toggle-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

.nav-toggle-btn:hover {
  border-color: var(--color-border-strong);
}

.nav-toggle-icon {
  display: none;
  width: 18px;
  height: 18px;
}

.app-layout .nav-toggle-icon-collapse {
  display: inline-flex;
}

.app-layout.is-nav-collapsed .nav-toggle-icon-collapse {
  display: none;
}

.app-layout.is-nav-collapsed .nav-toggle-icon-expand {
  display: inline-flex;
}

.side-footer {
  margin-top: auto;
  padding-top: 10px;
  position: sticky;
  bottom: 8px;
  display: flex;
}

.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  border-color: var(--color-border);
}

.app-layout.is-nav-collapsed .side-footer {
  justify-content: center;
}

.theme-icon {
  width: 18px;
  height: 18px;
}

.theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: inline;
}

html.theme-dark .theme-icon-moon {
  display: none;
}

html.theme-dark .theme-icon-sun {
  display: inline;
}

.app-layout.is-nav-collapsed .main-tabs.vertical {
  gap: 6px;
}

.app-layout.is-nav-collapsed .main-tab {
  justify-content: center;
  padding: 10px 8px;
}

.app-layout.is-nav-collapsed .nav-left {
  gap: 0;
  flex: 0 0 auto;
  width: auto;
  margin: 0 auto;
  justify-content: center;
}

.app-layout.is-nav-collapsed .nav-label,
.app-layout.is-nav-collapsed .nav-count,
.app-layout.is-nav-collapsed .nav-dev {
  display: none;
}

.side-overlay {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}
