.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  color: var(--text-primary);
  background: var(--surface-page);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px 18px;
  border: 0;
  border-right: 1px solid var(--border-default);
  background: var(--surface-sidebar);
  box-shadow: none;
}

.app-sidebar-brand {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 7px;
}

.app-sidebar-brand .brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 52%, var(--border-default));
  border-radius: 13px;
  background: var(--accent-primary);
  box-shadow: none;
}

.app-sidebar-brand .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-sidebar-brand small,
.app-sidebar-brand strong {
  display: block;
}

.app-sidebar-brand small {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.app-sidebar-brand strong {
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 760;
}

.app-sidebar .app-sidebar-nav.view-tabs {
  position: relative;
  isolation: isolate;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app-sidebar .app-sidebar-nav.view-tabs .tab-indicator {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  border-radius: 12px;
  background: var(--accent-primary);
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--motion-normal) var(--motion-ease),
    width var(--motion-normal) var(--motion-ease),
    height var(--motion-normal) var(--motion-ease),
    opacity var(--motion-fast) ease;
}

.app-sidebar .app-sidebar-nav.view-tabs .tab-indicator.no-transition {
  transition: none !important;
}

.app-sidebar .app-sidebar-nav.view-tabs .view-tab {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 0 13px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-muted);
  background: transparent !important;
  box-shadow: none !important;
  text-align: left;
  cursor: pointer;
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease;
}

.app-sidebar .app-sidebar-nav.view-tabs .view-tab.active {
  color: var(--text-on-accent);
  border-color: transparent;
  background: transparent !important;
}

.app-sidebar .app-sidebar-nav.view-tabs .view-tab-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  color: inherit;
  transform: none;
  transition: color var(--motion-fast) ease;
}

.app-sidebar .app-sidebar-nav.view-tabs .view-tab-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.app-sidebar .app-sidebar-nav.view-tabs .view-tab-label {
  position: static;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 680;
  white-space: nowrap;
  opacity: 1;
  transform: none;
  pointer-events: none;
}

.app-sidebar .app-sidebar-nav.view-tabs .view-tab-label::before {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .app-sidebar .app-sidebar-nav.view-tabs .view-tab:hover:not(.active) {
    color: var(--text-primary);
    border-color: var(--border-default);
    background: color-mix(in srgb, var(--surface-elevated) 72%, transparent) !important;
  }

  .app-sidebar .app-sidebar-nav.view-tabs .view-tab:hover .view-tab-icon,
  .app-sidebar .app-sidebar-nav.view-tabs .view-tab:hover .view-tab-label,
  .app-sidebar .app-sidebar-nav.view-tabs .view-tab:focus-visible .view-tab-icon,
  .app-sidebar .app-sidebar-nav.view-tabs .view-tab:focus-visible .view-tab-label {
    transform: none;
  }
}

.app-sidebar-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border-default);
}

.app-sidebar-footer .account-bar {
  position: static;
  top: auto;
  right: auto;
  width: 100%;
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
}

.app-sidebar-footer #userEmail {
  min-width: 0;
  overflow: hidden;
  padding: 0 5px 6px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-footer .btn-account {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 11px;
  color: var(--text-secondary);
  background: var(--surface-card);
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  transition:
    color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    background-color var(--motion-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .app-sidebar-footer .btn-account:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--surface-elevated);
    transform: none;
  }
}

.app-main {
  min-width: 0;
  min-height: 100dvh;
  color: var(--text-primary);
  background: var(--surface-page);
}

.app-topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(22px, 4vw, 44px) 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-topbar .top-copy h1 {
  margin: 0;
  color: var(--text-primary);
  font-family: inherit;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.08;
  font-weight: 790;
  letter-spacing: -.035em;
}

.app-topbar .top-copy p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-main > .app {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px clamp(22px, 4vw, 44px) 46px;
}

@media (max-width: 768px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .app-sidebar {
    position: static;
    height: auto;
    min-height: 0;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .app-sidebar-brand,
  .app-sidebar-footer {
    display: none;
  }

  .app-sidebar .app-sidebar-nav.view-tabs {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 120;
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 3px;
    padding: 6px;
    border: 1px solid var(--border-default);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-elevated) 94%, transparent);
    box-shadow: var(--shadow-elevated);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .app-sidebar .app-sidebar-nav.view-tabs .tab-indicator {
    border-radius: 13px;
  }

  .app-sidebar .app-sidebar-nav.view-tabs .view-tab {
    flex: 1 1 0;
    width: auto;
    height: 54px;
    min-height: 54px;
    display: grid;
    grid-template-rows: 20px auto;
    place-items: center;
    gap: 3px;
    padding: 5px 3px;
    text-align: center;
  }

  .app-sidebar .app-sidebar-nav.view-tabs .view-tab-icon {
    width: 19px;
    height: 19px;
  }

  .app-sidebar .app-sidebar-nav.view-tabs .view-tab-label {
    max-width: 100%;
    overflow: hidden;
    font-size: 9px;
    line-height: 1;
    text-overflow: ellipsis;
  }

  .app-main {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .app-topbar {
    min-height: 82px;
    padding: 20px 18px 8px;
  }

  .app-topbar .top-copy h1 {
    font-size: 28px;
  }

  .app-main > .app {
    padding: 14px 16px 28px;
  }
}
