.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 24% 18%, rgba(79, 111, 63, 0.16), transparent 30%),
    radial-gradient(circle at 76% 78%, rgba(32, 38, 46, 0.08), transparent 34%),
    linear-gradient(135deg, #eef1f4, #f8fafb);
}

.app-layout {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.topbar-title {
  display: grid;
  gap: 3px;
}

.topbar-title h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.topbar-title span {
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.backup-button {
  min-height: 34px;
  padding-inline: 12px;
  color: var(--text-soft);
  font-size: 11.5px;
}

.main-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  overflow: hidden;
  padding: 22px 28px 18px;
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  .app-layout {
    min-height: 100dvh;
    height: auto;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: visible;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar-actions .button,
  .topbar-actions .user-account-button {
    width: 100%;
    min-width: 0;
  }

  .main-content {
    overflow: visible;
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .login-shell {
    align-items: start;
    place-items: start stretch;
    padding: 16px;
  }

  .login-card {
    width: 100%;
    padding: 26px 20px 22px;
  }

  .topbar {
    padding: 14px;
  }

  .topbar-title h1 {
    font-size: 23px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 12px;
  }
}
